我的一片天

我的一片天
posts - 27, comments - 12, trackbacks - 0, articles - 16
   :: 首页 :: 新随笔 :: 联系 ::  :: 管理

2009年10月7日

     摘要: 1.设置TWSocketServer的port作为监听端口.

2.对于来自客户端的连接,必须先对TWSocketClient进行继承。

TTcpSrvClient = class(TWSocketClient)
public
//自定义的属性

end;

3.设置TWSocketServer的部分属性

.Port:=inttostr(usePort); //动态指定,来自www.cnitblog.com/xkz
.Banner:=''; //清除客户端连接后的自动信息
.BannerTooBusy:='';
.ClientClass:= TTcpSrvClient; //指定继承后的类,当客户端连入时,自动创建及释放

4.在ClientConnect(Sender: TObject; Client: TWSocketClient;
Error: Word)事件中,设置客户端有数据  阅读全文

posted @ 2009-10-07 22:40 xyz 阅读(2795) | 评论 (0)编辑 收藏