[fpc-pascal] Re: Odyssey: SSockets and Threads.
Michael Van Canneyt
michael at freepascal.org
Thu Apr 25 21:00:01 CEST 2013
On Thu, 25 Apr 2013, silvioprog wrote:
> 2013/4/25 silvioprog <silvioprog at gmail.com>
> Very nice article:
> Outdated, but very very nice. :)
> put all sockets currently connected in the read set;
> put the listening socket in the read set;
> Select(read set, no other sets, no timeout);
> respond to all sockets that are left in the read set;
> until false;
> :o So I need of "Select" function. If I am not mistaken it is not being used in ssockets. I'll to do it manually. I will implement it on my own.
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 handle.
You can perfectly do a fpselect() with the handles of the streams that ssockets uses.
More information about the fpc-pascal