v/vlib/net/websocket/events.v

22 lines
532 B
V
Raw Normal View History

module websocket
fn (mut ws Client) send_message_event(msg &Message) {
2020-04-08 21:19:01 +02:00
ws.eb.publish('on_message', ws, msg)
ws.log.debug('sending on_message event')
}
fn (mut ws Client) send_error_event(err string) {
2020-04-08 21:19:01 +02:00
ws.eb.publish('on_error', ws, err)
ws.log.debug('sending on_error event')
}
fn (mut ws Client) send_close_event() {
2020-04-08 21:19:01 +02:00
ws.eb.publish('on_close', ws, voidptr(0))
ws.log.debug('sending on_close event')
}
fn (mut ws Client) send_open_event() {
2020-04-08 21:19:01 +02:00
ws.eb.publish('on_open', ws, voidptr(0))
ws.log.debug('sending on_open event')
2020-04-08 21:19:01 +02:00
}