Re: [fpc-pascal] fpselect does not work on linux

2009-05-10 Thread Rainer Stratmann
Am Samstag, 9. Mai 2009 20:25 schrieb dmitry boyarintsev: How can I find out if a socket connection in a nonblocking mode is established? according to the man page, you're doing correct path: http://linux.die.net/man/2/connect i did use non-blocking connection for both Linux and OSX, and

[fpc-pascal] fpselect does not work on linux

2009-05-09 Thread Rainer Stratmann
To find out if a nonblocking socket has connected I use the following piece of code: With windows that works, but with linux I get alwas the result that the socket is writable. function is_writable_socket( sck : integer ) : boolean; var fds : tfdset; tv : timeval; begin {$ifdef linux}

Re: [fpc-pascal] fpselect does not work on linux

2009-05-09 Thread Michael Van Canneyt
On Sat, 9 May 2009, Rainer Stratmann wrote: To find out if a nonblocking socket has connected I use the following piece of code: With windows that works, but with linux I get alwas the result that the socket is writable. function is_writable_socket( sck : integer ) : boolean;

Re: [fpc-pascal] fpselect does not work on linux

2009-05-09 Thread Rainer Stratmann
Am Samstag, 9. Mai 2009 12:17 schrieb Michael Van Canneyt: On Sat, 9 May 2009, Rainer Stratmann wrote: To find out if a nonblocking socket has connected I use the following piece of code: With windows that works, but with linux I get alwas the result that the socket is writable.

Re: [fpc-pascal] fpselect does not work on linux

2009-05-09 Thread Michael Van Canneyt
On Sat, 9 May 2009, Rainer Stratmann wrote: Am Samstag, 9. Mai 2009 12:17 schrieb Michael Van Canneyt: On Sat, 9 May 2009, Rainer Stratmann wrote: To find out if a nonblocking socket has connected I use the following piece of code: With windows that works, but with linux I get

Re: [fpc-pascal] fpselect does not work on linux

2009-05-09 Thread Jonas Maebe
On 09 May 2009, at 09:38, Rainer Stratmann wrote: To find out if a nonblocking socket has connected I use the following piece of code: With windows that works, but with linux I get alwas the result that the socket is writable. function is_writable_socket( sck : integer ) : boolean; var

Re: [fpc-pascal] fpselect does not work on linux

2009-05-09 Thread Michael Van Canneyt
On Sat, 9 May 2009, Jonas Maebe wrote: On 09 May 2009, at 09:38, Rainer Stratmann wrote: To find out if a nonblocking socket has connected I use the following piece of code: With windows that works, but with linux I get alwas the result that the socket is writable. function

Re: [fpc-pascal] fpselect does not work on linux

2009-05-09 Thread fpclist
According to the FPC rtl.pdf version 2.2.2 Doc version 2.1 of June 2008, page 165, states, and I quote: Description:FPSelect checks one of the file descriptors in the FDSets to see if its status changed. //- On Saturday 09

Re: [fpc-pascal] fpselect does not work on linux

2009-05-09 Thread dmitry boyarintsev
hello Rainer, do you check the socket's writability by fpFD_ISSET(sck, fds) ? thanks, dmitry ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] fpselect does not work on linux

2009-05-09 Thread Michael Van Canneyt
On Sat, 9 May 2009, fpcl...@silvermono.co.za wrote: According to the FPC rtl.pdf version 2.2.2 Doc version 2.1 of June 2008, page 165, states, and I quote: Description:FPSelect checks one of the file descriptors in the FDSets to see if its status changed. I'll change it to something

Re: [fpc-pascal] fpselect does not work on linux

2009-05-09 Thread Rainer Stratmann
Select does *not* tell you if a file descriptor is writeable or readable. It tells you if the read/write operation will block. This is something subtly different. This is interesting for blocking mode. But since you can switch to nonblocking mode every operation will return immediately. Here

Re: [fpc-pascal] fpselect does not work on linux

2009-05-09 Thread Michael Van Canneyt
On Sat, 9 May 2009, Rainer Stratmann wrote: Select does *not* tell you if a file descriptor is writeable or readable. It tells you if the read/write operation will block. This is something subtly different. This is interesting for blocking mode. But since you can switch to nonblocking