客户通过Socket(InetAddress,port)建立与服务器的连接。服务器与客户都通过构造BufferedReader,PrintWriter来建立输入输出流,然后双方通过该输入输出流来相互传递信息,一旦收到客户方的连接请求,服务器accept()方法返回一个新建的Socket对象。客户端然后向服务器发送消息,比如注册,登录,查找好友等,服务器收到来自客户的请求后,针对不同的消息处理请求, 虽然UDP不可靠但是对于icq可靠性并不太重要,而且UDP快速,所以客户间发送信息通过UDP。用户登录时通过类DatagramPacket和DatagramSocket创建UDP包括其本地接受端口以及发送端口,默认端口为5000和5001,通过取得的好友的IP地址来向好友发送消息(send(DatagramPacket)和接受消息(receive(DatagramPacket))。当用户通过UDP收到消息后,可以通过DatagramPacket的方法InetAddress getAddress()得到对方的ip地址,通过对好友列表比较以判断是谁并提示用户收到某某的消息,然后用户选择该用户查看消息,如果好友列表没有该人就显示收到陌生人的消息。用户可以按陌生人按钮查看消息。
标签: BufferedReader InetAddress PrintWriter Socket
上传时间: 2016-10-26
上传用户:familiarsmile
The code on this diskette has been organized by chapter. Each subdirectory containing listing has a readme.txt describing program usage and any relevent file formats. The readme will also describe how to compile the target programs under IBM OS/2 (TM) using the using C Set++ compiler (TM). All programs on this diskette have been compiled and tested in this environment. The majority of programs on this diskette should port to other environments with only minor adjustments. The exception to this are those programs which utilize presentation manager for graphical display of program data. In particular, the grid1 programs in \chapt4\backprop\ and \chapt3\ fall into this latter category.
标签: subdirectory containing has organized
上传时间: 2016-10-28
上传用户:冇尾飞铊
用java实现飞鸽传书的源码文件,通过udp协议,参考该源码可以解决文件传输的高可靠要求。
上传时间: 2016-11-05
上传用户:二驱蚊器
源码..C#开发的手机短信发送接收程序,有兴趣朋友可以研究下-C# development of the SMS to send and receive proceedings, interested friends under study
上传时间: 2014-01-24
上传用户:cc1
基于DSP网络中的TCP/IP协议研究,本文通过对TCP/IP协议的具体分析,解决了以数字信号处理器(DSP)为核心的局域网络DSP端的IP地址问题,实现了DSP与PC机之间的UDP协议通信
上传时间: 2014-01-15
上传用户:zhouchang199
This manual documents the interfaces of the libxml library and has some short notes to help get you up to speed with using the library. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.
标签: interfaces documents the library
上传时间: 2016-11-08
上传用户:181992417
局域网聊天的小程序,TCP,UDP协议实现都有
上传时间: 2016-11-09
上传用户:xinyuzhiqiwuwu
synopsis的有限状态机编码方法的文档。 针对synopsis的综合环境,根据其综合工具的特点说明安全可靠、速度适合的FSM编码风格。 FSM coding style under synopsis. Used for verilog or vhdl designer. Good study data for ASIC newhand.
上传时间: 2014-01-09
上传用户:onewq
JAVA music player. Project Homepage : http://www.javazoom.net/jlgui/jlgui.html Developer Homepage : http://sourceforge.net/project/?group_id=1344 ----------------------------------------------------- To launch jlGui just doucle click under jlGui2.0.jar. If nothing appear then edit jlGui.bat (or jlGui.sh) script and setup JLGUI_HOME variable and launch the script. To play local file : Left click on "Eject" button. To play remote file/stream : Right click on "Eject" Button. To fill in playlist : Edit default.m3u file before launching jlGui.
标签: jlgui Developer Homepage javazoom
上传时间: 2016-11-16
上传用户:wpwpwlxwlx
tcpip 在44b0x板上的移植,ucos-ii,开发环境是ADS1.2。很长一段时间里,我没有在网上下到直接能在44B0X –RL8019 的ADS1.2环境下的 TCPIP 程序.而嵌入式之所以区别于8位单片机,最主要的是他能方便实现上网. 因此,学习嵌入式,没有掌握网络通信,算不上真正的嵌入式.于是自己根据网上下载 的程序,结合TCPIP原理,慢慢的修改, 终于程序能稳定运行了.现在的演示例子,同时能运行tcp和udp协议. Tcp的演示是通过一个小小的嵌入式网页来实现的, 而UDP是要有udp接收软件才能看到.本例有详细的演示说明文件。
上传时间: 2016-11-18
上传用户:saharawalker