async fn chat_route(
    req: HttpRequest,
    stream: web::Payload,
    srv: web::Data<Addr<Server>>,
) -> Result<HttpResponse, Error> {
    ws::start(
        WsSession {
            id: 0,
            session_id: 0,
            rng: rand::thread_rng(),
            hb: Instant::now(),
            room_addr: None,
            room: None,
            server_addr: srv.get_ref().clone(),
            is_login: false,
        },
        &req,
        stream,
    )
}
/// Entry point for user's websocket route
Entry point for user's websocket route
Entry point for user ' s websocket route
async fn chat_route(
    req: HttpRequest,
    stream: web::Payload,
    srv: web::Data<Addr<Server>>,
) -> Result<HttpResponse, Error> {
    ws::start(
        WsSession {
            id: 0,
            session_id: 0,
            rng: rand::thread_rng(),
            hb: Instant::now(),
            room_addr: None,
            room: None,
            server_addr: srv.get_ref().clone(),
            is_login: false,
        },
        &req,
        stream,
    )
}
async fn chat_route ( req : HttpRequest , stream : web :: Payload , srv : web :: Data < Addr < Server > > , ) -> Result < HttpResponse , Error > { ws :: start ( WsSession { id : 0 , session_id : 0 , rng : rand :: thread_rng ( ) , hb : Instant :: now ( ) , room_addr : None , room : None , server_addr : srv . get_ref ( ) . clone ( ) , is_login : false , } , & req , stream , ) }
Entry point for user's websocket route
Entry point for user ' s websocket route
req
HttpRequest
stream
web::Payload
srv
web::Data<Addr<Server>>
req
HttpRequest
stream
web::Payload
srv
web::Data<Addr<Server>>