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 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.