MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / recv

Method recv

src/net/websocket.rs:83–88  ·  view source on GitHub ↗

Pop the next incoming message. Use `while let Some(msg) = ws.recv()` to drain all messages that arrived since the last frame.

(&self)

Source from the content-addressed store, hash-verified

81 /// Use `while let Some(msg) = ws.recv()` to drain all messages
82 /// that arrived since the last frame.
83 pub fn recv(&self) -> Option<WsMessage> {
84 let mut mgr = super::NET_MANAGER.lock().unwrap();
85 let entry = mgr.websockets.get_mut(&self.id)?;
86 entry.frames_not_accessed = 0;
87 entry.state.try_recv()
88 }
89
90 /// Graceful close. Consumes the handle and removes the entry immediately.
91 pub fn close(self) {

Callers 1

ws_connectFunction · 0.80

Calls 1

try_recvMethod · 0.45

Tested by

no test coverage detected