public class UDPDiscoverySender
extends java.lang.Object
| Constructor and Description |
|---|
UDPDiscoverySender(java.lang.String host,
int port)
Constructor for the UDPDiscoverySender object
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Closes the socket connection.
|
void |
finalize()
Just being careful about closing the socket.
|
void |
passiveBroadcast(java.lang.String host,
int port,
java.util.ArrayList cacheNames)
This sends a message braodcasting our that the host and port is available for connections.
|
protected void |
passiveBroadcast(java.lang.String host,
int port,
java.util.ArrayList cacheNames,
long listenerId)
This allows you to set the sender id.
|
void |
requestBroadcast()
Ask other to broadcast their info the the multicast address.
|
void |
send(UDPDiscoveryMessage message)
Send messages.
|
public UDPDiscoverySender(java.lang.String host,
int port)
throws java.io.IOException
This sender can be used to send multiple messages.
When you are done sending, you should destroy the socket sender.
host - port - java.io.IOExceptionpublic void destroy()
public void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic void send(UDPDiscoveryMessage message) throws java.io.IOException
message - java.io.IOExceptionpublic void requestBroadcast()
throws java.io.IOException
java.io.IOExceptionpublic void passiveBroadcast(java.lang.String host,
int port,
java.util.ArrayList cacheNames)
throws java.io.IOException
It uses the vmid as the requesterDI
host - port - cacheNames - java.io.IOExceptionprotected void passiveBroadcast(java.lang.String host,
int port,
java.util.ArrayList cacheNames,
long listenerId)
throws java.io.IOException
host - port - cacheNames - listenerId - java.io.IOExceptionCopyright © 2002-2013 Apache Software Foundation. All Rights Reserved.