Class Connection

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    NioConnection, TcpConnection

    public abstract class Connection
    extends java.lang.Object
    implements java.io.Closeable
    Represents a connection to a peer
    • Field Detail

      • cookie

        public static final byte[] cookie
      • peer_addr

        protected Address peer_addr
      • last_access

        protected long last_access
    • Constructor Detail

      • Connection

        public Connection()
    • Method Detail

      • isOpen

        public abstract boolean isOpen()
      • isConnected

        public abstract boolean isConnected()
      • isConnectionPending

        public abstract boolean isConnectionPending()
      • localAddress

        public abstract Address localAddress()
      • peerAddress

        public abstract Address peerAddress()
      • isExpired

        public abstract boolean isExpired​(long millis)
      • connect

        public abstract void connect​(Address dest)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • start

        public abstract void start()
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • send

        public abstract void send​(byte[] buf,
                                  int offset,
                                  int length)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • send

        public abstract void send​(java.nio.ByteBuffer buf)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • status

        public abstract java.lang.String status()