mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2025-01-14 16:46:32 +00:00
Fix TCP Socket Connect not setting receive window class member.
This commit is contained in:
parent
b99dd94db9
commit
9f0e880fab
3 changed files with 8 additions and 5 deletions
Binary file not shown.
|
@ -1057,6 +1057,7 @@ I64 TCPSocketConnect(CTCPSocket *tcp_socket, CSocketAddressStorage *address)
|
||||||
}
|
}
|
||||||
|
|
||||||
tcp_socket->connection_time = tS;
|
tcp_socket->connection_time = tS;
|
||||||
|
tcp_socket->receive_window = TCP_WINDOW_SIZE;
|
||||||
|
|
||||||
tcp_socket->state = TCP_STATE_SYN_SENT;
|
tcp_socket->state = TCP_STATE_SYN_SENT;
|
||||||
TCPSendFlags(tcp_socket, TCPF_SYN);
|
TCPSendFlags(tcp_socket, TCPF_SYN);
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
CTCPSocket *tcp = TCPSocket(AF_INET);
|
CTCPSocket *tcp = TCPSocket(AF_INET);
|
||||||
U8 buffer_size = 16;
|
//U8 buffer_size = 16;
|
||||||
U8 *buffer = CAlloc(buffer_size);
|
//U8 *buffer = CAlloc(buffer_size);
|
||||||
|
U8 *buffer = "Hello world";
|
||||||
|
U8 buffer_size = StrLen(buffer);
|
||||||
|
|
||||||
CSocketAddressIPV4 *socket_addr = CAlloc(sizeof(CSocketAddressIPV4));
|
CSocketAddressIPV4 *socket_addr = CAlloc(sizeof(CSocketAddressIPV4));
|
||||||
|
|
||||||
*buffer = EndianU64(0xDEADBEEFC0DEFADE);
|
//*buffer = EndianU64(0xDEADBEEFC0DEFADE);
|
||||||
|
|
||||||
U0 TCPTest()
|
U0 TCPTest()
|
||||||
{
|
{
|
||||||
tcp->timeout = TCP_TIMEOUT * 3;
|
tcp->timeout = TCP_TIMEOUT * 3;
|
||||||
|
|
||||||
ClassRep(tcp);
|
|
||||||
|
|
||||||
CIPV4Address addr;
|
CIPV4Address addr;
|
||||||
PresentationToNetwork(AF_INET, "10.0.2.7", &addr);
|
PresentationToNetwork(AF_INET, "10.0.2.7", &addr);
|
||||||
|
|
||||||
|
@ -19,6 +19,8 @@ U0 TCPTest()
|
||||||
socket_addr->family = AF_INET;
|
socket_addr->family = AF_INET;
|
||||||
socket_addr->address.address = addr.address;
|
socket_addr->address.address = addr.address;
|
||||||
|
|
||||||
|
ClassRep(tcp);
|
||||||
|
|
||||||
"\nTrying to connect the socket\n";
|
"\nTrying to connect the socket\n";
|
||||||
if (TCPSocketConnect(tcp, socket_addr) == 0)
|
if (TCPSocketConnect(tcp, socket_addr) == 0)
|
||||||
"\nSocket connected.\n";
|
"\nSocket connected.\n";
|
||||||
|
|
Loading…
Reference in a new issue