[fpc-pascal] SocketError 183
Marco van de Voort
marcov at stack.nl
Sun Dec 23 14:45:33 CET 2012
In our previous episode, MegaBrutal said:
>
> fpRecv works correctly if I read after I written something first.
>
> I suspect 2 possible causes:
> - Is socketerror reset to 0 after a successful socket operation? Actually,
> I call fpRecv and then try to verify if it was successful by examining
> socketerror.
No, it doesn't. It did before 2003, but then it was changed, so now fprecv
return value signals success or not.
This is more like normal sockets conventions.
For a while, deprecated functions without fp did implement it, but they have
been deprecated since (long) before 2.2.0 and have been removed along the way.
(in 2.4.0 and 2.6.0)
> - Is socketerror thread-safe? My application is multi-threaded - maybe it
> reads the result of another thread's socket operation.
Afaik it is. On Windows it is an alias for wsagetlasterror on *nix mostly
for threadsafe errno.
More information about the fpc-pascal
mailing list