Class OtpSocketTransport

  • All Implemented Interfaces:
    OtpTransport

    public class OtpSocketTransport
    extends java.lang.Object
    implements OtpTransport
    Default socket-based client transport
    • Constructor Detail

      • OtpSocketTransport

        public OtpSocketTransport​(java.lang.String addr,
                                  int port)
                           throws java.net.UnknownHostException,
                                  java.io.IOException
        Throws:
        java.net.UnknownHostException
        java.io.IOException
        See Also:
        Socket(String, int)
      • OtpSocketTransport

        public OtpSocketTransport​(java.net.InetAddress addr,
                                  int port)
                           throws java.net.UnknownHostException,
                                  java.io.IOException
        Throws:
        java.net.UnknownHostException
        java.io.IOException
        See Also:
        Socket(InetAddress, int)
      • OtpSocketTransport

        public OtpSocketTransport​(java.net.Socket s)
        Socket wrapping constructor
        Parameters:
        s - socket to wrap
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Specified by:
        getInputStream in interface OtpTransport
        Throws:
        java.io.IOException
        See Also:
        Socket.getInputStream()
      • getOutputStream

        public java.io.OutputStream getOutputStream()
                                             throws java.io.IOException
        Specified by:
        getOutputStream in interface OtpTransport
        Throws:
        java.io.IOException
        See Also:
        Socket.getOutputStream()
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface OtpTransport
        Throws:
        java.io.IOException
        See Also:
        Socket.close()