MCPcopy Create free account
hub / github.com/actix/examples / ChatSession

Class ChatSession

websockets/chat-tcp/src/session.rs:28–40  ·  view source on GitHub ↗

`ChatSession` actor is responsible for tcp peer communications.

Source from the content-addressed store, hash-verified

26
27/// `ChatSession` actor is responsible for tcp peer communications.
28pub struct ChatSession {
29 /// unique session id
30 id: u64,
31 /// this is address of chat server
32 addr: Addr<ChatServer>,
33 /// Client must send ping at least once per 10 seconds, otherwise we drop
34 /// connection.
35 hb: Instant,
36 /// joined room
37 room: String,
38 /// Framed wrapper
39 framed: actix::io::FramedWrite<ChatResponse, WriteHalf<TcpStream>, ChatCodec>,
40}
41
42impl Actor for ChatSession {
43 /// For tcp communication we are going to use `FramedContext`.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected