none
Receive UDP broadcast message in TCP Server

    Question

  • Hi,

    I'm very new to network programming.

    I would like to know if a broadcast message sent from a UDP client be received by a TCP server running in on the same port.

    For Example:

    UDP client sents a broadcast message to IP address 192.168.1.255 and Port 11000

    Can a TCP server running on the same port(11000) receive this message?

    Thanks in advance.

    Sunday, December 16, 2012 1:09 PM

Answers

  • TCP and UDP are different protocols.  I do not believe a tcpclient will hear a udp message
    • Marked as answer by bipinkrishna Tuesday, December 18, 2012 7:42 AM
    Sunday, December 16, 2012 1:44 PM
  • A broadcast message is Multicasdt which is a specfici type of UDP message.  Multicast IP address are in th erange 224.X.X.X to 239.X.X.X. You can't have a UDP and TCP message on the same port number.  Normally UDP (not Multicaset) as well are all TCP require a dedicated connection between a one client and one server  and cannot be broadcaset to more that one IP address.  Any computer can open more than one connection.  An IP datagram consists of the following

    1) Source IP address

    2) Destination IP address

    3) Port number.

    You  cannot have two connection with all 3 parameters the same.  So if you have more than one connection between two computers each connection must have a different port number.  Multicast you can have more than one server sending Multicast to the same destination IP address with the same port number.

    Normally a Server application will setup a listeners for either TCP, UDP using a port number.  With Muticast the client will setup the listener using the port number. 


    jdweng

    • Marked as answer by bipinkrishna Tuesday, December 18, 2012 7:42 AM
    Sunday, December 16, 2012 9:10 PM

All replies

  • TCP and UDP are different protocols.  I do not believe a tcpclient will hear a udp message
    • Marked as answer by bipinkrishna Tuesday, December 18, 2012 7:42 AM
    Sunday, December 16, 2012 1:44 PM
  • A broadcast message is Multicasdt which is a specfici type of UDP message.  Multicast IP address are in th erange 224.X.X.X to 239.X.X.X. You can't have a UDP and TCP message on the same port number.  Normally UDP (not Multicaset) as well are all TCP require a dedicated connection between a one client and one server  and cannot be broadcaset to more that one IP address.  Any computer can open more than one connection.  An IP datagram consists of the following

    1) Source IP address

    2) Destination IP address

    3) Port number.

    You  cannot have two connection with all 3 parameters the same.  So if you have more than one connection between two computers each connection must have a different port number.  Multicast you can have more than one server sending Multicast to the same destination IP address with the same port number.

    Normally a Server application will setup a listeners for either TCP, UDP using a port number.  With Muticast the client will setup the listener using the port number. 


    jdweng

    • Marked as answer by bipinkrishna Tuesday, December 18, 2012 7:42 AM
    Sunday, December 16, 2012 9:10 PM