in reply to Detect socket
You could try calling getsockopt( $mysocket, getprotobyname( 'tcp' ), TCP_NODELAY ).
On my OS I get an error that tells me if the file descriptor provided is not a socket:
getsockopt( STDOUT, getprotobyname( 'tcp' ), TCP_NODELAY ) or warn "?$! : $^E";; ?Unknown error : An operation was attempted on something that is not +a socket
|
|---|