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.IOException
public void destroy()
public void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void send(UDPDiscoveryMessage message) throws java.io.IOException
message
- java.io.IOException
public void requestBroadcast() throws java.io.IOException
java.io.IOException
public 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.IOException
protected void passiveBroadcast(java.lang.String host, int port, java.util.ArrayList cacheNames, long listenerId) throws java.io.IOException
host
- port
- cacheNames
- listenerId
- java.io.IOException
Copyright © 2002-2013 Apache Software Foundation. All Rights Reserved.