Networking Forums

Networking Forums > Computer Networking > Linux Networking > Distinguish between TCP and connected UDP sockets

Reply
Thread Tools Display Modes

Distinguish between TCP and connected UDP sockets

 
 
glchin@hotmail.com
Guest
Posts: n/a

 
      03-19-2005, 09:42 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

 
Reply With Quote
 
 
 
 
=?iso-8859-1?q?M=E5ns_Rullg=E5rd?=
Guest
Posts: n/a

 
      03-19-2005, 10:24 PM
(E-Mail Removed) 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
(E-Mail Removed)
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Distinguish between a reset packet and a normal packet sairam Linux Networking 4 03-27-2007 04:03 AM
Distinguish nntp download from upload * Tong * Linux Networking 1 03-07-2005 07:42 PM
problem: wireless MN-500 connected, but not connected Andrew Smith Broadband Hardware 2 08-21-2004 12:28 AM
problem: connected, but not connected to a wireless network Andrew Smith Wireless Networks 0 08-20-2004 07:51 PM
how to distinguish switch or hub per software? 0 Linux Networking 2 07-31-2003 01:38 AM



1 2 3 4 5 6 7 8 9 10 11