java.lang.Object
org.jempeg.empeg.protocol.AbstractEmpegDiscoverer
org.jempeg.empeg.protocol.NetworkEmpegDiscoverer
- public class NetworkEmpegDiscoverer
- extends AbstractEmpegDiscoverer
NetworkEmpegDiscoverer implements discovery over a Socket-based
TCP/IP network. Discovery is based on broadcasting a datagram to
over port 8300 and listening for the Empeg to respond.
- Version:
- 2.0a1 $Date: 2002/01/10 02:48:26 $
|
Constructor Summary |
NetworkEmpegDiscoverer()
Constructs a new NetworkEmpegDiscoverer using 255.255.255.255
as the broadcast address. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DISCOVERY_PORT
private static final int DISCOVERY_PORT
- See Also:
- Constant Field Values
MAX_RETRIES
private static final int MAX_RETRIES
- See Also:
- Constant Field Values
DISCOVERY_STRING
private static final java.lang.String DISCOVERY_STRING
- See Also:
- Constant Field Values
myDoNotBroadcastTo
private java.lang.String myDoNotBroadcastTo
NetworkEmpegDiscoverer
public NetworkEmpegDiscoverer()
throws java.io.IOException
- Constructs a new NetworkEmpegDiscoverer using 255.255.255.255
as the broadcast address.
createConnection
public static SocketConnection createConnection(java.net.InetAddress _inetAddress)
throws java.io.IOException
- Creates a SocketConnection based on the given InetAddress
setDoNotBroadcastTo
public void setDoNotBroadcastTo(java.lang.String _doNotBroadcastTo)
- Sets a comma-separated list of broadcast addresses
to not broadcast on. This is an optimization if
someone has a NIC that they KNOW will not have an
Empeg on it.
discover
public boolean discover(int _timeoutMillis)
throws java.io.IOException
- Description copied from class:
AbstractEmpegDiscoverer
- Implemented by subclasses. This will actually perform the
subclass-dependent mechanism of finding an Empeg (within the given
timeout time)
- Specified by:
discover in class AbstractEmpegDiscoverer
broadcastDiscoveryRequest
protected void broadcastDiscoveryRequest(java.net.DatagramSocket _socket,
java.net.InetAddress _broadcastAddress)
throws java.io.IOException
waitForDiscoveryResponses
protected boolean waitForDiscoveryResponses(java.net.DatagramSocket _socket,
int _timeoutMillis,
java.util.Vector _discoveredVec)
throws java.io.IOException
parseDiscoveryResponse
protected boolean parseDiscoveryResponse(java.net.DatagramPacket _packet)
throws java.io.IOException
main
public static void main(java.lang.String[] _args)
throws java.lang.Throwable