Receiving Unicast packets on Multicast socket

Discussion in 'Java' started by Rich DeMarinis, Oct 22, 2004.

  1. Is it possible to have a single MulticastSocket also receive Unicast
    packets in Java? I'm able to bind one of each socket to the same port
    but I'd like to be able to use just one socket. I'm running under
    RedHat 9.0.

    Thanks,
    Rich
     
    Rich DeMarinis, Oct 22, 2004
    #1
    1. Advertising

  2. On 22 Oct 2004 14:06:38 -0700, Rich DeMarinis wrote:
    > Is it possible to have a single MulticastSocket also receive Unicast
    > packets in Java? I'm able to bind one of each socket to the same
    > port but I'd like to be able to use just one socket. I'm running
    > under RedHat 9.0.


    Yes, since your application uses the same port number for unicast and
    multicast datagrams.

    MulticastSocket is a subclass of DatagramSocket, so it can receive
    unicast datagrams. This is regardless of any multicast groups it has
    joined, however it will only receive datagrams (of either kind) sent
    to the bound port.

    /gordon

    --
    [ do not email me copies of your followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
     
    Gordon Beaton, Oct 25, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Flex
    Replies:
    0
    Views:
    411
  2. Ralph Butler

    pyzeroconf unicast question

    Ralph Butler, Apr 13, 2006, in forum: Python
    Replies:
    0
    Views:
    388
    Ralph Butler
    Apr 13, 2006
  3. Replies:
    5
    Views:
    657
    Nick Keighley
    Jun 8, 2007
  4. Grant Edwards

    Problem receiving UDP broadcast packets.

    Grant Edwards, Apr 19, 2011, in forum: Python
    Replies:
    34
    Views:
    3,160
    Grant Edwards
    Apr 21, 2011
  5. James W. Mills

    Missing packets in multicast receiver.

    James W. Mills, Apr 11, 2007, in forum: Ruby
    Replies:
    1
    Views:
    217
    Douglas Wells
    Apr 12, 2007
Loading...

Share This Page