diff options
Diffstat (limited to 'documentation/content/zh-tw/books/developers-handbook/sockets/chapter.adoc')
-rw-r--r-- | documentation/content/zh-tw/books/developers-handbook/sockets/chapter.adoc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/documentation/content/zh-tw/books/developers-handbook/sockets/chapter.adoc b/documentation/content/zh-tw/books/developers-handbook/sockets/chapter.adoc index 97edb64caa..80e6284948 100644 --- a/documentation/content/zh-tw/books/developers-handbook/sockets/chapter.adoc +++ b/documentation/content/zh-tw/books/developers-handbook/sockets/chapter.adoc @@ -454,7 +454,7 @@ int main() { Go ahead, enter it in your editor, save it as [.filename]#daytime.c#, then compile and run it: -[source,bash] +[source,shell] .... % cc -O3 -o daytime daytime.c % ./daytime @@ -669,7 +669,7 @@ Not all protocols are that simple. Many receive a request from the client, reply Now, go ahead, save the above source code as [.filename]#daytimed.c# (it is customary to end the names of daemons with the letter `d`). After you have compiled it, try running it: -[source,bash] +[source,shell] .... % ./daytimed bind: Permission denied @@ -680,7 +680,7 @@ What happened here? As you will recall, the _daytime_ protocol uses port 13. But Try again, this time as the superuser: -[source,bash] +[source,shell] .... # ./daytimed # @@ -688,7 +688,7 @@ Try again, this time as the superuser: What... Nothing? Let us try again: -[source,bash] +[source,shell] .... # ./daytimed @@ -700,7 +700,7 @@ Every port can only be bound by one program at a time. Our first attempt was ind Fine, we know it is running in the background. But is it working? How do we know it is a proper _daytime_ server? Simple: -[source,bash] +[source,shell] .... % telnet localhost 13 @@ -718,7 +718,7 @@ telnet tried the new IPv6, and failed. It retried with IPv4 and succeeded. The d If you have access to another UNIX(R) system via telnet, you can use it to test accessing the server remotely. My computer does not have a static IP address, so this is what I did: -[source,bash] +[source,shell] .... % who @@ -736,7 +736,7 @@ Connection closed by foreign host. Again, it worked. Will it work using the domain name? -[source,bash] +[source,shell] .... % telnet r47.bfm.org 13 @@ -829,7 +829,7 @@ We now can type a domain name (or an IP address, it works both ways) on the comm Since it takes virtually no time to get the time from your local server, you could run daytime twice in a row: First to get the time from `time.nist.gov`, the second time from your own system. You can then compare the results and see how exact your system clock is: -[source,bash] +[source,shell] .... % daytime ; daytime localhost |