x.net: fix new_tcp_socket()
parent
fa8f5df817
commit
702a80fc5a
|
@ -6,6 +6,7 @@ pub const (
|
||||||
used_import = 1 + fontstash.used_import
|
used_import = 1 + fontstash.used_import
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
#flag windows -I @VROOT/thirdparty/freetype/include
|
#flag windows -I @VROOT/thirdparty/freetype/include
|
||||||
#flag windows -L @VROOT/thirdparty/freetype/win64
|
#flag windows -L @VROOT/thirdparty/freetype/win64
|
||||||
|
|
||||||
|
@ -22,6 +23,7 @@ pub const (
|
||||||
#flag darwin -lfreetype
|
#flag darwin -lfreetype
|
||||||
|
|
||||||
#flag darwin -lpng -lbz2 -lz
|
#flag darwin -lpng -lbz2 -lz
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -273,8 +273,8 @@ fn new_tcp_socket() ?TcpSocket {
|
||||||
s := TcpSocket {
|
s := TcpSocket {
|
||||||
handle: sockfd
|
handle: sockfd
|
||||||
}
|
}
|
||||||
s.set_option_bool(.reuse_addr, true)?
|
//s.set_option_bool(.reuse_addr, true)?
|
||||||
//s.set_option_int(.reuse_addr, 1)?
|
s.set_option_int(.reuse_addr, 1)?
|
||||||
$if windows {
|
$if windows {
|
||||||
t := true
|
t := true
|
||||||
socket_error(C.ioctlsocket(sockfd, fionbio, &t))?
|
socket_error(C.ioctlsocket(sockfd, fionbio, &t))?
|
||||||
|
|
|
@ -8,7 +8,7 @@ interface WebsocketIO {
|
||||||
socket_write(bytes []byte) ?
|
socket_write(bytes []byte) ?
|
||||||
}
|
}
|
||||||
|
|
||||||
// socket_read_into reads into the provided buffer with it's lenght
|
// socket_read_into reads into the provided buffer with its length
|
||||||
fn (mut ws Client) socket_read_into(mut buffer []byte) ?int {
|
fn (mut ws Client) socket_read_into(mut buffer []byte) ?int {
|
||||||
lock {
|
lock {
|
||||||
if ws.is_ssl {
|
if ws.is_ssl {
|
||||||
|
|
Loading…
Reference in New Issue