Georgi Georgiev schrieb:

There is another way, if you use file descriptor calls
for non-blocked socket:

...
count:=fdRead(socket,data,size);
socket_eof:=(count=0) and (LinuxError=0);
...

eeehm normally fdread returns -1 for closed sockets, so you can obmit the LinuxError part and just write:


socket_eof := count <= 0;

This will work both for files (where zero means EOF) and sockets (where -1 means error, such as broken pipe)


- Sebastian



_______________________________________________ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to