2004_p2p chatting program

Click here to load reader

Upload: nakcheon-jung

Post on 12-Apr-2017

233 views

Category:

Documents


5 download

TRANSCRIPT

  • P2P Programming

    - Messenger Program

    : 6

  • P2P Programming

  • P2P Program

    P2P P2P

  • Messenger Program

    BBS

  • . . . ?

  • Linuxer MSN ICQ Gaim , , MSN ICQ . 2003 MSN , . one program one function , , .

  • Linux GUI P2P . .24

  • P2P

  • P2P P2P . IP

  • .

    , ,

  • GUI X-Window mode Terminal mode GUI , ICQ MSN .

  • 1

    - P2P

    P2P Programming

  • 1. MSN Messenger

  • 1. MSN Messenger

    VER ILN LSG QRY H PING QNGPING SYN GTC ( )BLP ( )BPR CVR USR XFR CHG FLN ()NLN (, )OUT

  • 2. P2P , .

    1

  • 2. P2P Nagle Algorithm .

    Reuse address .

    // turn off the Nagle algorithm int state, opt_val = true, opt_len; state = setsockopt( g_serv_sock, IPPROTO_TCP, TCP_NODELAY, &opt_val, sizeof(opt_val) ); if( state ) return false // turn on the Reuse address state = setsockopt( g_serv_sock, SOL_SOCKET, SO_REUSEADDR, &opt_val, sizeof(opt_val) ); if( state ) return false

  • 3. (my_chat_file.list)

    1) 2) pid 3) user id 4) uid mychat pid 5) uid

  • 1

    2

  • 4. IP IP ( )? IP, IP Mapping , . IP . , MS windows Linux . .

  • 2

    -

    P2P Programming

  • 1. (.my_chat_friends.list)

    1) - IP - - user id 2) 3) IP 4) user id 5) IP ( )

  • 1. , IP .my_chat_friends.list (5~1 ) , .my_chat_friends.list . .my_chat_friends.list .

  • 2. . . GUI . , . GUI . . .

  • 3

    -

    P2P Programming

  • 1.X-Window VS Terminal

    TerminalX-WindowGTK+ QTncursesif( !isatty(STDIN_FILENO) ) { disp_xwindow(); } else { disp_console(); }

  • 1.1.Ncurses Programming

  • 1.1.Ncurses Programming http://joinc.co.kr/modules.php?name=News&file=article&sid=47 ncurses http://romeo.hufs.ac.kr/~dondek/UnixLinux/lpg/lpg_8.html

  • 1.2.X-Window ProgrammingQt-designer familyC++

    Glade familyC GTK+ GNOME Qt-designer .

  • 1.2.Qt-designer

  • 1.2.Qt-designer

  • 1.2.Glade

  • 1.2.Glade

  • 1.2.X-Window ProgrammingGladehttp://www.sysmng.com/linux/kldp/html/Glade-KLDP/Glade-KLDP.html

    Qt-designerhttp://kr.hancom.com/zone/solution/qt_04.php#designer

  • 2. . Nagle algorithm . ,

    , .

  • 3. MSN, ICQ, Nate On .MSN http://zdnet.co.kr/techupdate/lecture/network/0,39024995,10069335,00.htm Ethreal

    MSN .Zdnet 2004/03/02 Ethreal .

  • P2P Programming

  • http://zdnet.co.kr/techupdate/lecture/network/0,39024995,10069335,00.htm http://doc.trolltech.com/3.3/designer-manual.html http://www.terms.co.kr http://kr.hancom.com/zone/solution/qt_04.php#designer http://romeo.hufs.ac.kr/~dondek/UnixLinux/lpg/lpg_8.html http://joinc.co.kr/modules.php?name=News&file=article&sid=47 vanced Programming in the UNIX Environment -stevens- http://database.sarang.net/study/glibc/0.htm TCP/IP -- UNIX Network Programming Volume1 -stevens- UNIX Network Programming Volume2 -stevens-