`ChatSession` actor is responsible for tcp peer communications.
| 26 | |
| 27 | /// `ChatSession` actor is responsible for tcp peer communications. |
| 28 | pub 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 | |
| 42 | impl Actor for ChatSession { |
| 43 | /// For tcp communication we are going to use `FramedContext`. |
nothing calls this directly
no outgoing calls
no test coverage detected