mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: ~500 more byte=>u8
This commit is contained in:
@ -28,7 +28,7 @@ fn (mut ws Client) socket_read(mut buffer []u8) ?int {
|
||||
}
|
||||
|
||||
// socket_read reads from socket into the provided byte pointer and length
|
||||
fn (mut ws Client) socket_read_ptr(buf_ptr &byte, len int) ?int {
|
||||
fn (mut ws Client) socket_read_ptr(buf_ptr &u8, len int) ?int {
|
||||
lock {
|
||||
if ws.state in [.closed, .closing] || ws.conn.sock.handle <= 1 {
|
||||
return error('socket_read_ptr: trying to read a closed socket')
|
||||
|
@ -60,7 +60,7 @@ pub enum State {
|
||||
pub struct Message {
|
||||
pub:
|
||||
opcode OPCode // websocket frame type of this message
|
||||
payload []u8 // payload of the message
|
||||
payload []u8 // payload of the message
|
||||
}
|
||||
|
||||
// OPCode represents the supported websocket frame types
|
||||
@ -229,7 +229,7 @@ pub fn (mut ws Client) pong() ? {
|
||||
}
|
||||
|
||||
// write_ptr writes len bytes provided a byteptr with a websocket messagetype
|
||||
pub fn (mut ws Client) write_ptr(bytes &byte, payload_len int, code OPCode) ?int {
|
||||
pub fn (mut ws Client) write_ptr(bytes &u8, payload_len int, code OPCode) ?int {
|
||||
// ws.debug_log('write_ptr code: $code')
|
||||
if ws.state != .open || ws.conn.sock.handle < 1 {
|
||||
// todo: send error here later
|
||||
|
Reference in New Issue
Block a user