2011-04-25

NP作業2


homework2 作業題目
In this homework, you will write a pair of Little Messenger client and server. The requirements of the Messenger system is as follows.
1. The Messenger client operates in dual modes: command mode and chatting mode. (10%)
2. A user can register a new account from the Messenger client on line, and log in on the Messenger server. (20%)
3. The user can list on-line users on the server.(10%)
4. A user can send messages to another on-line user, or start a conversation with him or her.(20%)
5. A user can broadcast a message to all on-line users. (10%)
6. A user can leave a off-line message to another, and he/she can see the off-line message when he/she logs in.(10%)
7. A user can log out the server. (5%)
8. Add 5 points for each new function.
You do not have to design a GUI like Live Messenger. A text-mode interface is pretty fine. The server can be on an arbitrary port. Due date: Apr. 29.


note:

gcc -o


(ca)

工作站> setenv LC_ALL zh_TW.UTF-8
把目前連線全部的編碼方式都改成UTF-8


[抓蟲中]
以下是流程圖,一樣是用office2010 power point快取圖樣拉的。









參考資料:

1. The World of select()
http://www.lowtek.com/sockets/select.html

So one main advantage of using select() is that your server will only require a single process to handle all requests. Thus, your server will not need shared memory or synchronization primitives for different 'tasks' to communicate.
> ya!! 一個process!! no more fork!!


2. 
unpv13e/
select/strcliselect01.c
select/strcliselect02.c
tcpcliserv/tcpservselect01.c
tcpcliserv/tcpservpoll01.c


3. Socket Client Examples
 http://www.tutorialspoint.com/unix_sockets/socket_client_example.htm

4. gcc 語法
http://aikosenoo.pixnet.net/blog/post/23038692

沒有留言:

張貼留言

Check for typo before sending