[fpc-pascal] INVALID_SOCKET constant not defined for Linux
LacaK
lacak at zoznam.sk
Tue Mar 28 12:34:34 CEST 2017
> Under *nix socket calls are just general runtime calls, and they use the
> same convention and constants for errorhandling as all other calls.
As I know "nothing" about Linux, then it is safe to check?:
socket := Sockets.FPSocket(...);
if socket = -1 then // invalid socket returned due to error ...
This technique is used in fcl-net which should be cross-platform.
So I am right, when I say that also in Linux invald socket = -1
(in other words: in case of error syscall() returns always -1)
Becuase in other place I see another test "if socket < 0 then ..."
(which may mean that any negative value can be returned)
L.
More information about the fpc-pascal
mailing list