Unix Programming - Distinguish between TCP and connected UDP sockets

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > March 2005 > Distinguish between TCP and connected UDP sockets





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Distinguish between TCP and connected UDP sockets
glchin@hotmail.com

2005-03-19, 5:49 pm

I have a few functions written for TCP sockets and wish to use them for
connected UDP sockets. Most of the code is common, but I need a way to
distinguish between the two socket types given a descriptor. What's
the easiest way to do this?

Thanks in advance.


GC

Måns Rullgård

2005-03-19, 5:49 pm

glchin@hotmail.com writes:

> I have a few functions written for TCP sockets and wish to use them for
> connected UDP sockets. Most of the code is common, but I need a way to
> distinguish between the two socket types given a descriptor. What's
> the easiest way to do this?


getsockopt(sock, SOL_SOCKET, SO_TYPE, ...)

--
Måns Rullgård
mru@inprovide.com
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com