System/Api/Tcp: Make s->close() work on bound sockets

This commit is contained in:
Alec Murphy
2025-09-20 19:08:03 -04:00
parent 405a603b0f
commit 51e54e89d5

View File

@@ -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;
}