fn new<T: Handler>(
        logger:     L,
        service_id: u16,
        session_id: u32, 
        addr: &SocketAddr,
        event_loop: &mut EventLoop<T>) -> Result<SessionContext<L>> {
        let stream = try_svc_io!(ServiceStream::connect(addr));
        
        register_socket(session2token(session_id), stream.get_ref(), 
            true, true, event_loop);
        
        let res = SessionContext {
            logger:        logger,
            service_id:    service_id,
            session_id:    session_id,
            stream:        stream,
            input_buffer:  WriteBuffer::new(256 * 1024),
            output_buffer: WriteBuffer::new(0),
            read_buffer:   Box::new([0u8; 32768]),
            write_tout:    Timeout::new()
        };
        
        Ok(res)
    }
/// Create a new session context for a given session ID and service 
/// address.
Create a new session context for a given session ID and service
address.
Create a new session context for a given session ID and service address .
fn new<T: Handler>(
        logger:     L,
        service_id: u16,
        session_id: u32, 
        addr: &SocketAddr,
        event_loop: &mut EventLoop<T>) -> Result<SessionContext<L>> {
        let stream = try_svc_io!(ServiceStream::connect(addr));
        register_socket(session2token(session_id), stream.get_ref(), 
            true, true, event_loop);
        let res = SessionContext {
            logger:        logger,
            service_id:    service_id,
            session_id:    session_id,
            stream:        stream,
            input_buffer:  WriteBuffer::new(256 * 1024),
            output_buffer: WriteBuffer::new(0),
            read_buffer:   Box::new([0u8; 32768]),
            write_tout:    Timeout::new()
        };
        Ok(res)
    }
fn new < T : Handler > ( logger : L , service_id : u16 , session_id : u32 , addr : & SocketAddr , event_loop : & mut EventLoop < T > ) -> Result < SessionContext < L > > { let stream = try_svc_io ! ( ServiceStream connect ( addr ) ) ; register_socket ( session2token ( session_id ) , stream . get_ref ( ) , true , true , event_loop ) ; let res = SessionContext { logger : logger , service_id : service_id , session_id : session_id , stream : stream , input_buffer : WriteBuffer :: new ( 256 * 1024 ) , output_buffer : WriteBuffer :: new ( 0 ) , read_buffer : Box :: new ( [ 0u8 ; 32768 ] ) , write_tout : Timeout :: new ( ) } ; Ok ( res ) }
Create a new session context for a given session ID and service
address.
Create a new session context for a given session ID and service address .
logger
L
service_id
u16
session_id
u32
addr
&SocketAddr
event_loop
&mut EventLoop<T>
logger
L
service_id
u16
session_id
u32
addr
&SocketAddr
event_loop
&mut EventLoop<T>