[fpc-pascal] FPCONNECT NOT WORKING?

Martin lazarus at mfriebe.de
Fri Aug 21 20:18:13 CEST 2009


epergola wrote:
> Sorry, you are right.
> I am using non blocking sockets (lNet library), no visual package, on the
> wince-arm
> side, attempting to communicate with a non blocking (Delphi) socket on my
> PC.
> Everything works fine (did a lot of data send and receive) except that 
> fpconnect with correct address (PC computer name) and port number still
> returns 
> -1. 
>   
....
> which always returned TRUE, even when fpconnect fails;
> Any idea as to what I may check (beside the return code of fpconnect which
> does not work)
> to see if the conneccion actually took place?
> Thanks 
>   
that would defeat the idea of a none-blocking connection.

none-blocking does not only relate to reading/writing data, but also to 
making the connection, which also could take several seconds and much 
longer.

A none blocking connection will return true in the connect event, if all 
local requirements where met. If you want to wait for the connection to 
take place (including the full timeout, if it fails) you should use a 
blocking socket for that.

Martin



More information about the fpc-pascal mailing list