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.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to