S
simon.yeah
Unregistered / Unconfirmed
GUEST, unregistred user!
library Project2;
uses
SysUtils,
Classes,
scktcomp,
dialogs;
type
Tmysocket=class(Tobject)
client:Tclientsocket;
procedure c_connect(Sender: TObject; Socket: TCustomWinSocket);
end;
procedure Tmysocket.c_connect(Sender: TObject;Socket: TCustomWinSocket);
begin
showmessage('nihao');
end;
var
mysocket:Tmysocket;
{$R *.res}
begin
mysocket:=Tmysocket.Create();
mysocket.client:=Tclientsocket.Create(nil);
mysocket.client.ClientType:=ctnonblocking;
mysocket.client.Address:='127.0.0.1';
mysocket.client.Port:=80;
mysocket.client.Active:=true;
mysocket.client.OnConnect:=mysocket.c_connect;
end.
为什么连接上服务端时mysocket.client.OnConnect事件没有响应执行mysocket.c_connect过程,有哪位高手帮忙解决下!!
uses
SysUtils,
Classes,
scktcomp,
dialogs;
type
Tmysocket=class(Tobject)
client:Tclientsocket;
procedure c_connect(Sender: TObject; Socket: TCustomWinSocket);
end;
procedure Tmysocket.c_connect(Sender: TObject;Socket: TCustomWinSocket);
begin
showmessage('nihao');
end;
var
mysocket:Tmysocket;
{$R *.res}
begin
mysocket:=Tmysocket.Create();
mysocket.client:=Tclientsocket.Create(nil);
mysocket.client.ClientType:=ctnonblocking;
mysocket.client.Address:='127.0.0.1';
mysocket.client.Port:=80;
mysocket.client.Active:=true;
mysocket.client.OnConnect:=mysocket.c_connect;
end.
为什么连接上服务端时mysocket.client.OnConnect事件没有响应执行mysocket.c_connect过程,有哪位高手帮忙解决下!!