Home > Back-end >  Consult: winsock recv not receive data
Consult: winsock recv not receive data

Time:10-13

Move (s [1], buf, Length (s));
Result:=SOCKET_ERROR & lt;> WinSock2. Send (SKT, buf, Length (s), 0).

SocketTimeout. Tv_sec:=the Timeout div. 1000;
SocketTimeout. Tv_usec:=1000 * (Timeout mod 1000);


SocketSet. Fd_count:=1;
SocketSet. Fd_array [0] :=SKT;
If (WinSock2. Select (0, @ SocketSet, nil nil, @ SocketTimeout) & gt; 0) then
The begin
L:=WinSock2 recv (SKT, buf, 1024, MSG_PEEK);//default is blocked, namely synchronous
SetString (Result, buf, l);
End

I hope I can synchronous read data returned by the server, not line, and through capture fd_onread (asynchronous), yes, have to know? I'm not familiar with the socket model, thank you,
Most Synapse library also not line, is no problem,

A bit nerve-racking, server in this machine,

The send (), the fourth parameter

CodePudding user response:

Use datasnap people passing by

CodePudding user response:

Don't a timeout, with sleep

CodePudding user response:

You have the data returned debugging tools are used to determine
  • Related