B
bestdelpher
Unregistered / Unconfirmed
GUEST, unregistred user!
recv(s: TSocket; var Buf; len, flags: Integer)
当有多个连接时,我怎样取得s信息。
case Event of
FD_CONNECT:
begin
end;
FD_ACCEPT:
begin
AddrLen := sizeof(cssockaddrin);
SockClientInfo[m].Socket := Accept(ServerSocket,@cssockaddrin,@AddrLen);
SockClientInfo[m].ip:=strpas(inet_ntoa(in_addr(cssockaddrin.sin_addr.S_addr)));
m:=m+1;
Memo1.Lines.Add(inttostr(SockClientInfo[m].Socket));
Memo1.Lines.Add(SockClientInfo[m].ip);
end;
FD_READ:
begin
RecClientSocket:=FindSocket(msg.WParam);
createthread(nil,0,@SockRecv,@RecClientSocket,0,thid);
end;
当有多个连接时,我怎样取得s信息。
case Event of
FD_CONNECT:
begin
end;
FD_ACCEPT:
begin
AddrLen := sizeof(cssockaddrin);
SockClientInfo[m].Socket := Accept(ServerSocket,@cssockaddrin,@AddrLen);
SockClientInfo[m].ip:=strpas(inet_ntoa(in_addr(cssockaddrin.sin_addr.S_addr)));
m:=m+1;
Memo1.Lines.Add(inttostr(SockClientInfo[m].Socket));
Memo1.Lines.Add(SockClientInfo[m].ip);
end;
FD_READ:
begin
RecClientSocket:=FindSocket(msg.WParam);
createthread(nil,0,@SockRecv,@RecClientSocket,0,thid);
end;