mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
net/openssl/websocket: implement io.Writer (#8980)
This commit is contained in:
@ -170,7 +170,7 @@ pub fn (mut c StreamConn) close() ? {
|
||||
}
|
||||
|
||||
// write_ptr blocks and attempts to write all data
|
||||
pub fn (mut c StreamConn) write_ptr(b byteptr, len int) ? {
|
||||
pub fn (mut c StreamConn) write_ptr(b byteptr, len int) ?int {
|
||||
$if trace_unix ? {
|
||||
eprintln(
|
||||
'>>> StreamConn.write_ptr | c.sock.handle: $c.sock.handle | b: ${ptr_str(b)} len: $len |\n' +
|
||||
@ -194,17 +194,17 @@ pub fn (mut c StreamConn) write_ptr(b byteptr, len int) ? {
|
||||
}
|
||||
total_sent += sent
|
||||
}
|
||||
return total_sent
|
||||
}
|
||||
return none
|
||||
}
|
||||
|
||||
// write blocks and attempts to write all data
|
||||
pub fn (mut c StreamConn) write(bytes []byte) ? {
|
||||
pub fn (mut c StreamConn) write(bytes []byte) ?int {
|
||||
return c.write_ptr(bytes.data, bytes.len)
|
||||
}
|
||||
|
||||
// write_str blocks and attempts to write all data
|
||||
pub fn (mut c StreamConn) write_str(s string) ? {
|
||||
pub fn (mut c StreamConn) write_str(s string) ?int {
|
||||
return c.write_ptr(s.str, s.len)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user