Struct engine_io::socket::Socket
[−]
[src]
pub struct Socket { /* 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(&mut self, reason: &str)
fn closed(&self) -> bool
fn send(&self, data: Vec<u8>)
Send a message to the client
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(&[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(&[u8]) + 'static
Set callback for when client sends a message
Trait Implementations
impl Clone for Socket
[src]
fn clone(&self) -> Socket
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more