p2ps.imp.endpoint.UDP
Class UDPMulticastEndpoint
java.lang.Object
p2ps.imp.endpoint.UDP.UDPEndpoint
p2ps.imp.endpoint.UDP.UDPMulticastEndpoint
- All Implemented Interfaces:
- Endpoint, UDPEndpointSchemes
- public class UDPMulticastEndpoint
- extends UDPEndpoint
An extension to UDPOutputEndpoint that enables sendind to a multicast address.
- Version:
- $Revision: 295 $
- Author:
- Ian Wang
|
Constructor Summary |
UDPMulticastEndpoint(boolean discovery)
Creates a multicast socket attached to a new port |
UDPMulticastEndpoint(java.lang.String groupaddr,
int port)
Creates a multicast socket attaches to the specified group address and
port |
|
Method Summary |
java.net.URI |
getEndpointURI()
|
java.net.URI |
getSendURI()
|
protected void |
initSocket(int port,
boolean input)
Initialises the socket |
boolean |
isOutputEndpoint()
|
void |
send(byte[] message)
Sends a message from the endpoint to the address the endpoint is bound
to, with no sendid. |
void |
send(java.lang.String sendid,
byte[] message)
Sends a message from the endpoint to the address the endpoint is bound
to, along with the send id for this message. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UDPMulticastEndpoint
public UDPMulticastEndpoint(boolean discovery)
throws java.io.IOException
- Creates a multicast socket attached to a new port
UDPMulticastEndpoint
public UDPMulticastEndpoint(java.lang.String groupaddr,
int port)
throws java.io.IOException
- Creates a multicast socket attaches to the specified group address and
port
initSocket
protected void initSocket(int port,
boolean input)
throws java.io.IOException
- Initialises the socket
- Overrides:
initSocket in class UDPEndpoint
- Throws:
java.io.IOException
getEndpointURI
public java.net.URI getEndpointURI()
- Specified by:
getEndpointURI in interface Endpoint- Overrides:
getEndpointURI in class UDPEndpoint
- Returns:
- the transport protocol for this socket
getSendURI
public java.net.URI getSendURI()
- Specified by:
getSendURI in interface Endpoint- Overrides:
getSendURI in class UDPEndpoint
- Returns:
- the address being sent to by this endpoint (if known)
isOutputEndpoint
public boolean isOutputEndpoint()
- Specified by:
isOutputEndpoint in interface Endpoint- Overrides:
isOutputEndpoint in class UDPEndpoint
- Returns:
- true if this endpoint is output enabled
send
public void send(byte[] message)
throws java.io.IOException
- Sends a message from the endpoint to the address the endpoint is bound
to, with no sendid.
- Specified by:
send in interface Endpoint- Overrides:
send in class UDPEndpoint
- Throws:
java.io.IOException
send
public void send(java.lang.String sendid,
byte[] message)
throws java.io.IOException
- Sends a message from the endpoint to the address the endpoint is bound
to, along with the send id for this message.
- Specified by:
send in interface Endpoint- Overrides:
send in class UDPEndpoint
- Throws:
java.io.IOException