tags:

views:

43

answers:

1

A third Party library gives us just the created socket on which listen data. Now this socket can be udp or tcp,

I am not able to figure out which options to give to getsockopt to figure out whether the socket is udp or tcp.

SOL_SOCKET, SO_BROADCAST doesn't seem to serve this purpose.

+1  A: 

Try SO_TYPE. SOCK_DGRAM or SOCK_STREAM should be for UDP or TCP, respectively.

WhirlWind