org.jgroups.protocols

Class UDP_NIO.Connector

Enclosing Class:
UDP_NIO
Implemented Interfaces:
Runnable

public static class UDP_NIO.Connector
extends java.lang.Object
implements Runnable

Manages a multicast and unicast socket on a given interface (NIC). The multicast socket is used to listen for incoming multicast packets, the unicast socket is used to (1) listen for incoming unicast packets, (2) to send unicast packets and (3) to send multicast packets

Field Summary

protected byte[]
receive_buffer
Buffer for incoming unicast packets
protected org.jgroups.protocols.UDP_NIO.Connector.SenderThread
sender_thread
protected Thread
t

Constructor Summary

Connector(NetworkInterface bind_interface, int local_bind_port, int port_range, int receive_buffer_size, int receive_sock_buf_size, int send_sock_buf_size, int ip_ttl, Receiver receiver)

Method Summary

NetworkInterface
getBindInterface()
SocketAddress
getLocalAddress()
void
run()
void
send(DatagramPacket packet)
Sends a message using mcast_sock
void
start()
void
stop()
Stops the connector.
String
toString()

Field Details

receive_buffer

protected byte[] receive_buffer
Buffer for incoming unicast packets

sender_thread

protected org.jgroups.protocols.UDP_NIO.Connector.SenderThread sender_thread

t

protected Thread t

Constructor Details

Connector

public Connector(NetworkInterface bind_interface,
                 int local_bind_port,
                 int port_range,
                 int receive_buffer_size,
                 int receive_sock_buf_size,
                 int send_sock_buf_size,
                 int ip_ttl,
                 Receiver receiver)
            throws IOException

Method Details

getBindInterface

public NetworkInterface getBindInterface()

getLocalAddress

public SocketAddress getLocalAddress()

run

public void run()

send

public void send(DatagramPacket packet)
            throws Exception
Sends a message using mcast_sock

start

public void start()
            throws Exception

stop

public void stop()
Stops the connector. After this call, start() cannot be called, but a new connector has to be created

toString

public String toString()

Copyright B) 1998-2005 Bela Ban. All Rights Reserved.