C/C++ setsockopt() with UDP

Sep 29, 2004
18,656
68
91
I am looking through the setsockopt() API in visual studio.

I have a question. All the documentation for setsockopt() refers to TCP. What about UDP? Can these options be set?

In particular, what about these options:
TCP_NODELAY (seems TCP specific)
SO_SNDBUF

Thanks!

UPDATE 1
Found one answer:
"The TCP_NODELAY option is specific to TCP/IP service providers"
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
I'm pretty sure you can use any non TCP/IP related options with setsockopt.

http://msdn.microsoft.com/en-u...y/ms738603(VS.85).aspx

That page talks about setting a couple of options for UDP connections with setsockopt, so I would imagine others would work. It would probably easier to just test it, setsockopt will return an error code if it doesn't work at least :)