求个解决方案DLL封装socket后。发现onread不能执行!而且当EXE发来信息后不执行onread函数。。constructor TConnection.Create;
begin
inherited;
ClientSocket := TClientSocket.Create(nil);
ClientSocket.Host := '127.0.0.1';
ClientSocket.Port := 10095;
ClientSocket.ClientType := ctNonBlocking;
ClientSocket.OnRead := csocketRead;
ClientSocket.Active := True;
FsSocket := ClientSocket;
end;
procedure TConnection.csocketRead(Sender: TObject; Socket: TCustomWinSocket);
begin
OutputDebugStringA(PChar('123123123123123'));
end;
begin
inherited;
ClientSocket := TClientSocket.Create(nil);
ClientSocket.Host := '127.0.0.1';
ClientSocket.Port := 10095;
ClientSocket.ClientType := ctNonBlocking;
ClientSocket.OnRead := csocketRead;
ClientSocket.Active := True;
FsSocket := ClientSocket;
end;
procedure TConnection.csocketRead(Sender: TObject; Socket: TCustomWinSocket);
begin
OutputDebugStringA(PChar('123123123123123'));
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货