mirror of
https://git.checksum.fail/alec/erythros
synced 2025-12-10 13:09:55 +02:00
System/Api/Tcp: Make s->close() work on bound sockets
This commit is contained in:
@@ -25,6 +25,7 @@ class TcpSocket {
|
||||
U64 send_buffer_filled;
|
||||
U64 send_buffer_kick; // We set this to 1 when we have data available to net,
|
||||
// Net sets back to 0 when ready to receive
|
||||
U64 close_kick; // We set this to 1 to force close the connection
|
||||
U0 (*close)();
|
||||
U64 (*receive)(U64 buf, U64 length);
|
||||
U0 (*send)(U64 buf, U64 length);
|
||||
@@ -103,6 +104,7 @@ U0 @tcp_socket_close(TcpSocket* s)
|
||||
Free(s->receive);
|
||||
if (s->send)
|
||||
Free(s->send);
|
||||
s->close_kick = 1;
|
||||
s->state = TCP_SOCKET_STATE_CLOSED;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user