[fpc-pascal] FPCONNECT NOT WORKING?

Rainer Stratmann RainerStratmann at t-online.de
Fri Aug 21 20:13:27 CEST 2009


if you use non-blocking sockets, you have to repeat the fpconnect call as i 
know. until the connection is ok.
i did it also for my application this way.
there exist also other ways to see if the connection is ok after the connect 
call...
but i don't know if they are compatible to arm system

Am Freitag, 21. August 2009 18:48 schrieb epergola:
> 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.
> Hence, this lines in the lNet lib (modified by me)
> if SetupSocket(APort, Address) then begin
>     i:=fpConnect(FHandle, psockaddr(@FAddress), SizeOf(FAddress));
>     if i>=0 then
>       FConnecting := True;
>     Result := FConnecting;
>   end;
> will always return false for the Connect function.
> The original code in lNet was
> if SetupSocket(APort, Address) then begin
>     pConnect(FHandle, psockaddr(@FAddress), SizeOf(FAddress));
>     FConnecting := True;
>     Result := FConnecting;
>   end;
> 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
>
> more information
> linux? windows?
> blocking or nonblocking sockets?



More information about the fpc-pascal mailing list