Re: How can I Listen for TCP and UDP on a single port?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 02, 2001 at 01:08:18AM -0800, Kevin wrote:
> Hi,
>     I want to listen the TCP connection and UDP connection on a single port.
> And use the select() to dectect the connection.

TCP and UDP ports are seperate, so you can just do that. Create your two
sockets, one TCP, one UDP, select() on both, and do your I/O.

>     I have two questions:
> 1. How can I build a socket for listening both of the two types of
> connection?

Why would you want that?

> 2. How can get to know it is a TCP connection or a UDP connection?

It's one or the other socket that select()s successfully. You create them,
you know which is which.

regards
  Patrick
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux