Class LocalClientSocket

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class LocalClientSocket
    extends java.net.Socket
    This class wraps Socket and does not permit it to be directed to connect anywhere other than to localhost.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String _rcsid  
      protected int currentPort  
      protected static java.net.InetAddress loopbackAddress  
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalClientSocket​(int port)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void connect​(java.net.SocketAddress endpoint)  
      void connect​(java.net.SocketAddress endpoint, int timeout)  
      • Methods inherited from class java.net.Socket

        bind, close, getChannel, getInetAddress, getInputStream, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getOption, getOutputStream, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setKeepAlive, setOOBInline, setOption, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setSoLinger, setSoTimeout, setTcpNoDelay, setTrafficClass, shutdownInput, shutdownOutput, supportedOptions, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • loopbackAddress

        protected static java.net.InetAddress loopbackAddress
      • currentPort

        protected int currentPort
    • Constructor Detail

      • LocalClientSocket

        public LocalClientSocket​(int port)
                          throws java.io.IOException
        Constructor
        Throws:
        java.io.IOException
    • Method Detail

      • connect

        public void connect​(java.net.SocketAddress endpoint)
                     throws java.io.IOException
        Overrides:
        connect in class java.net.Socket
        Throws:
        java.io.IOException
      • connect

        public void connect​(java.net.SocketAddress endpoint,
                            int timeout)
                     throws java.io.IOException
        Overrides:
        connect in class java.net.Socket
        Throws:
        java.io.IOException