TWiki
>
CS450fall09 Web
>
Homework3
(2009-09-14, Main.jakob)
(raw view)
E
dit
A
ttach
---+ Homework 3 - due Mon 9/21 In this homework, we finally get to the mother of all serious socket programming: the select() system call. select() allows a program to wait for multiple file descriptors at once, whether reading, writing or just looking for error messages from a socket. Create a simple chat server for telnet clients, using TCP sockets and select(). Let every connected client receive using TCP sockets and every message sent by every other client. Pay attention to the details. Specifically, you are required to handle the commands "say" and "name", keep track of and report (on connection close) the number of received bytes for each client. You should also keep track of and use the name set by the client, as shown below. The number of clients can be more than two, but will be less than 16 during grading. Here is an example transcript with 2 connected telnet clients: <verbatim> ./hw3 10080 Got connection (Client 1). Client 1 set name to: Jakob Got connection (Client 2). Jakob said: Hello Jakob said: How are you? Client 2 said: Hello, I am fine. Client 1 said: Who are you? Client 2 set name to: Tomas. Tomas disconnected. A total of 27 bytes received from Tomas. Jakob disconnected. A total of 28 bytes received from Jakob. where one of the telnet sessions would look like: telnet localhost 10080 name Jakob Client 2 connected. say Hello say How are you? Client 2> Hello, I am fine. say Who are you? Client 2 set name to: Tomas. Tomas disconnected. ^] close </verbatim> TIP: the selectserver.c example will give you an excellent start.
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2009-09-14 - 02:29:18 - Main.jakob
CS450fall09
Syllabus
Lecture Notes
-
References
Homeworks
-
Subversion
-
VMWare
-
schedule
-
hints
list archives
FAQ
ERF2054 map
[edit this
]
Log In
CS450fall09 Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
ABOUT US
Our Department
Recent News
Contact Us
ACADEMICS
Prospective Students
Undergraduate
CS Minor
Graduate
Courses
RESEARCH
Overview
By Faculty
Labs
PEOPLE
Faculty
Adjuncts
Staff
Students
Alumni
Copyright 2016 The Board of Trustees
of the University of Illinois.
webmaster@cs.uic.edu
WISEST
Helping Women Faculty Advance
Funded by NSF