On Sat, May 4, 2013 at 9:42 PM, Ludo Brands <ludo.bra...@free.fr> wrote:
> > However, in your code you do > if (c = 0) or (c = SOCKET_ERROR) then > begin > Error; > > which is not correct. c=0 is the result of select returning after a > timeout. It is not an error. > The fact that > if Socket.Select(10000, slRead) = erNone then > is blocked forever is not normal. It should at least return after 10 > seconds. > I am not testing in linux it is broked with me and i have not good internet to fix it. now in this example http://msdn.microsoft.com/en-us/library/windows/desktop/ms737526%28v=vs.85%29.aspx They not use Select before accept and in http://msdn.microsoft.com/en-us/library/windows/desktop/ms740141%28v=vs.85%29.aspx >The parameter *readfds* identifies the sockets that are to be checked for readability. If the socket is currently in the *listen*<http://msdn.microsoft.com/en-us/library/windows/desktop/ms739168%28v=vs.85%29.aspx>state, it will be marked as readable if >an incoming connection request has been received such that an *accept*<http://msdn.microsoft.com/en-us/library/windows/desktop/ms737526%28v=vs.85%29.aspx>is guaranteed to complete *without blocking*. I still not sure in windows need Select, but maybe in Linux only, but i can't test it there. -- I am using last revision of Lazarus, FPC 2.6 on Windows XP SP3 Best Regards Zaher Dirkey
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal