Fix TCP Socket Connect not setting receive window class member.

This commit is contained in:
TomAwezome 2021-05-12 17:32:07 -04:00
parent b99dd94db9
commit 9f0e880fab
3 changed files with 8 additions and 5 deletions

View file

@ -1057,6 +1057,7 @@ I64 TCPSocketConnect(CTCPSocket *tcp_socket, CSocketAddressStorage *address)
}
tcp_socket->connection_time = tS;
tcp_socket->receive_window = TCP_WINDOW_SIZE;
tcp_socket->state = TCP_STATE_SYN_SENT;
TCPSendFlags(tcp_socket, TCPF_SYN);

View file

@ -1,17 +1,17 @@
CTCPSocket *tcp = TCPSocket(AF_INET);
U8 buffer_size = 16;
U8 *buffer = CAlloc(buffer_size);
//U8 buffer_size = 16;
//U8 *buffer = CAlloc(buffer_size);
U8 *buffer = "Hello world";
U8 buffer_size = StrLen(buffer);
CSocketAddressIPV4 *socket_addr = CAlloc(sizeof(CSocketAddressIPV4));
*buffer = EndianU64(0xDEADBEEFC0DEFADE);
//*buffer = EndianU64(0xDEADBEEFC0DEFADE);
U0 TCPTest()
{
tcp->timeout = TCP_TIMEOUT * 3;
ClassRep(tcp);
CIPV4Address addr;
PresentationToNetwork(AF_INET, "10.0.2.7", &addr);
@ -19,6 +19,8 @@ U0 TCPTest()
socket_addr->family = AF_INET;
socket_addr->address.address = addr.address;
ClassRep(tcp);
"\nTrying to connect the socket\n";
if (TCPSocketConnect(tcp, socket_addr) == 0)
"\nSocket connected.\n";