Struct engine_io::socket::Socket
[−]
[src]
pub struct Socket {
// some fields omitted
}Methods
impl Socket[src]
fn id(&self) -> String
fn get_last_pong(&self) -> Instant
fn get_last_ping(&self) -> Instant
fn b64(&self) -> bool
fn xhr2(&self) -> bool
fn jsonp_index(&self) -> Option<i32>
fn close(&self, reason: &str)
fn closed(&self) -> bool
fn emit(&self, data: Packet)
fn on_packet<F>(&self, f: F) where F: Fn(Packet) + 'static
Set callback for when a packet is sent to the client (message, ping)
fn on_flush<F>(&self, f: F) where F: Fn(Vec<Packet>) + 'static
Set callback for when the write buffer is flushed
fn on_close<F>(&self, f: F) where F: Fn(&str) + 'static
Set callback for when the client is disconnected
fn on_message<F>(&self, f: F) where F: Fn(Vec<u8>) + 'static
Set callback for when client sends a message