65 The telnet command The telnet command as opposed to the telnet service does

65 the telnet command the telnet command as opposed

This preview shows page 77 - 80 out of 102 pages.

6.5 The telnet command The telnet command, as opposed to the telnet service, does not only contact the well-known port number , but can also be used to send a message to any port. For example, instead of the command finger [email protected]
Image of page 77
to get information on user mark from the finger database, we could contact the well-known port on host `mymachine' as follows: anyon% telnet anyon finger Trying 129.240.22.14 ... Connected to anyon. Escape character is '^]'. mark Login name: mark In real life: Mark Burgess Directory: /mn/anyon/u2/mark Shell: /local/bin/tcsh On since Aug 14 11:59:39 on ttyp1 from :0.0 17 minutes Idle Time Mail last read Sun Aug 14 14:27:02 1994 No Plan. Or had finger not been in /etc/services , we could have written telnet hostname 79 Not all services accept textual input in this way, but telnet will try to contact their ports nevertheless. 6.6 X11 The X11 window system, used by Unix, is a client-server based application. A user's workstation runs a server process called X , whose job it is to display windows on the user's display . Each application the user wishes to run is a client which must contact the server in order to have its output displayed on the X-display. Figure 6.2: The X windowing system. By making this simple client-server abstraction, it makes no difference whether applications are running on the same host as the X-display, or whether they are running over the network. X uses its own system of protocols which is layered on top of socket communication. Strangely, X and Sun's variant News are the only window systems which have understood the point of networking. All other window systems require you to run programs on the computer at which you are sitting. 6.7 html: hypertext markup language A further example of a protocol is the world wide web hypertext markup (formatting) language (html). This insists upon simple rules for formatting pages and references. Exercises 1. Explain what `protocol' means. 2. Describe briefly the client-server model. 3. What role do dæmons play in with respect to the unix kernel? Why are servers daemons? Project Make a simple client-server model which commuicates via unix files. The server should be sent an arithmetic problem to solve, for example: . The client should send this request to the server, and the server should send back the answer. The client must be able to exit gracefully if the server does not answer for any reason. (Hint: you could use the `sleep' command to wait for the server to reply.) You will need to think of the following:
Image of page 78
1. What filenames should you use to send messages from the client to the server and from the server to the client? 2. Since the client and the server are independent processes, you need to find a way of discovering when the client and the server have finished writing their replies, so that you don't read only half of the answer by mistake.
Image of page 79
Image of page 80

You've reached the end of your free preview.

Want to read all 102 pages?

  • One '20

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors