Package 

Class IceSocketWrapper

  • All Implemented Interfaces:

    
    public abstract class IceSocketWrapper
    
                        

    Abstract socket wrapper that define a socket that could be UDP, TCP...

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract void send(DatagramPacket p) Sends a DatagramPacket from this socket It is a utility method to provide a common way to send for both UDP and TCP socket.
      abstract void receive(DatagramPacket p) Receives a DatagramPacket from this socket.
      abstract void close() Closes this socket.
      abstract InetAddress getLocalAddress() Get local address.
      abstract int getLocalPort() Get local port.
      abstract SocketAddress getLocalSocketAddress() Get socket address.
      abstract Socket getTCPSocket() Returns Socket object if the delegate socket is a TCP one, null otherwise.
      abstract DatagramSocket getUDPSocket() Returns DatagramSocket object if the delegate socket is a UDP one, null otherwise.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • send

         abstract void send(DatagramPacket p)

        Sends a DatagramPacket from this socket It is a utility method to provide a common way to send for both UDP and TCP socket. If the underlying socket is a TCP one, it is still possible to get the OutputStream and do stuff with it.

        Parameters:
        p - DatagramPacket to send
      • receive

         abstract void receive(DatagramPacket p)

        Receives a DatagramPacket from this socket. It is a utility method to provide a common way to receive for both UDP and TCP socket. If the underlying socket is a TCP one, it is still possible to get the InputStream and do stuff with it.

        Parameters:
        p - DatagramPacket
      • close

         abstract void close()

        Closes this socket.

      • getTCPSocket

         abstract Socket getTCPSocket()

        Returns Socket object if the delegate socket is a TCP one, null otherwise.

      • getUDPSocket

         abstract DatagramSocket getUDPSocket()

        Returns DatagramSocket object if the delegate socket is a UDP one, null otherwise.