[fpc-pascal] Re: Odyssey: SSockets and Threads.
silvioprog at gmail.com
Thu Apr 25 21:41:06 CEST 2013
2013/4/25 Michael Van Canneyt <michael at freepascal.org>
> Well, ssockets is very low level.
> fpselect() is mostly useful when you combine multiple file descriptors at
> once. Although it can be done, IMHO it makes little sense to create a
> select() method on the socket stream, since it would only have one socket
> You can perfectly do a fpselect() with the handles of the streams that
> ssockets uses.
The socket of Delphi and Synapse implements WaitForData:
function TWinSocketStream.WaitForData(Timeout: Longint): Boolean;
TimeVal.tv_sec := Timeout div 1000;
TimeVal.tv_usec := (Timeout mod 1000) * 1000;
Result := select(0, @FDSet, nil, nil, @TimeVal) > 0;
I do not know where it would be used, it's just an observation hehe...
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal