1,593
社区成员
发帖
与我相关
我的任务
分享
while True do
begin
Acceptsc :=WSAAccept(Listensc, Nil, Nil, Nil, 0);
if Acceptsc =SOCKET_ERROR then
begin
closesocket(Listensc);
Exit;
end;
//感觉应该在这个地方加入对Acceptsc 的验证
end;
if Acceptsc =SOCKET_ERROR then
begin
closesocket(Listensc);
Result :=6;
Continue;
end;
//***********************获取客户端IP地址和端口号 **************
FillChar(ClientIPAddress, Length(ClientIPAddress), #0);
StrMove(ClientIPAddress, inet_ntoa(sti.sin_addr), Length(ClientIPAddress));
ClientPort :=ntohs(sti.sin_port);
//***********************获取注册字符串*************
FillChar(RegisterStr, Length(RegisterStr), #0);
if Recv(Acceptsc, RegisterStr, Length(RegisterStr), MSG_OOB) <>0 then
begin;
end;