public void connectSession ( final Session session , EventHandler ... eventHandlers ) throws InterruptedException , Exception { InetSocketAddress udpAddress = null ; if ( null != udpClient ) { udpAddress = doUdpConnection ( session ) ; } if ( null != eventHandlers ) { for ( EventHandler eventHandler : eventHandlers ) { session . addHandler ( eventHandler ) ; if ( eventHandler instanceof SessionEventHandler ) { ( ( SessionEventHandler ) eventHandler ) . setSession ( session ) ; } } } MessageBuffer < ChannelBuffer > buffer = loginHelper . getLoginBuffer ( udpAddress ) ; Event loginEvent = Events . event ( buffer , Events . LOG_IN ) ; doTcpConnection ( session , loginEvent ) ; }
Connects the session to remote jetserver . Depending on the connection parameters provided to LoginHelper it can connect both TCP and UDP transports .