org.sapia.ubik.net.udp
Class UDPConnection

java.lang.Object
  extended by org.sapia.ubik.net.udp.UDPConnection
All Implemented Interfaces:
Connection
Direct Known Subclasses:
UdpRmiConnection

public class UDPConnection
extends java.lang.Object
implements Connection

Author:
Yanick Duchesne 16-Jun-2003

Field Summary
protected  int _bufsz
           
 
Constructor Summary
UDPConnection(java.net.DatagramSocket localServer, java.net.DatagramPacket pack, int bufsz, int timeout)
          Constructor for UDPConnection.
UDPConnection(UDPServerAddress addr, int bufsz, int timeout)
          Constructor for UDPConnection.
 
Method Summary
 void close()
          Closes this connection.
protected  ObjectStreamFactory getFactory()
           
 ServerAddress getServerAddress()
          Returns "address" of the server with which this connection communicates.
 java.lang.Object receive()
          Receives an object from the server with which this connection communicates.
protected  void send(byte[] bytes)
           
 void send(java.lang.Object o)
          Sends the given object to the server with which this connection communicates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_bufsz

protected int _bufsz
Constructor Detail

UDPConnection

public UDPConnection(UDPServerAddress addr,
                     int bufsz,
                     int timeout)
Constructor for UDPConnection.


UDPConnection

public UDPConnection(java.net.DatagramSocket localServer,
                     java.net.DatagramPacket pack,
                     int bufsz,
                     int timeout)
Constructor for UDPConnection.

Method Detail

close

public void close()
Description copied from interface: Connection
Closes this connection.

Specified by:
close in interface Connection
See Also:
Connection.close()

getServerAddress

public ServerAddress getServerAddress()
Description copied from interface: Connection
Returns "address" of the server with which this connection communicates.

Specified by:
getServerAddress in interface Connection
Returns:
a ServerAddress.
See Also:
Connection.getServerAddress()

receive

public java.lang.Object receive()
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException,
                                java.rmi.RemoteException
Description copied from interface: Connection
Receives an object from the server with which this connection communicates.

Specified by:
receive in interface Connection
Returns:
an Object.
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.rmi.RemoteException
See Also:
Connection.receive()

send

public void send(java.lang.Object o)
          throws java.io.IOException,
                 java.rmi.RemoteException
Description copied from interface: Connection
Sends the given object to the server with which this connection communicates.

Specified by:
send in interface Connection
Throws:
java.io.IOException
java.rmi.RemoteException
See Also:
Connection.send(Object)

send

protected void send(byte[] bytes)
             throws java.io.IOException,
                    java.rmi.RemoteException
Throws:
java.io.IOException
java.rmi.RemoteException

getFactory

protected ObjectStreamFactory getFactory()


Copyright © 2010 Sapia OSS. All Rights Reserved.