Class SocketForwardingConnectListener

  • All Implemented Interfaces:
    ConnectListener

    public class SocketForwardingConnectListener
    extends java.lang.Object
    implements ConnectListener
    A ConnectListener that forwards what is received over the channel to a socket and vice-versa.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.net.SocketAddress addr  
    • Constructor Summary

      Constructors 
      Constructor Description
      SocketForwardingConnectListener​(java.net.SocketAddress addr)
      Create with a SocketAddress this listener will forward to.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void gotConnect​(Channel.Forwarded chan)
      On connect, confirm the channel and start forwarding.
      • Methods inherited from class java.lang.Object

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

      • addr

        protected final java.net.SocketAddress addr
    • Constructor Detail

      • SocketForwardingConnectListener

        public SocketForwardingConnectListener​(java.net.SocketAddress addr)
        Create with a SocketAddress this listener will forward to.
    • Method Detail

      • gotConnect

        public void gotConnect​(Channel.Forwarded chan)
                        throws java.io.IOException
        On connect, confirm the channel and start forwarding.
        Specified by:
        gotConnect in interface ConnectListener
        Parameters:
        chan - the forwarded channel
        Throws:
        java.io.IOException - if there is a problem handling the channel