*/
void TCP_Initialise(void)
{
+ giTCP_NextOutPort += rand()%32;
IPStack_AddFile(&gTCP_ServerFile);
IPStack_AddFile(&gTCP_ClientFile);
IPv4_RegisterCallback(IP4PROT_TCP, TCP_GetPacket);
packet->SourcePort = htons(Connection->LocalPort);
packet->DestPort = htons(Connection->RemotePort);
packet->DataOffset = (sizeof(tTCPHeader)/4)*16;
- packet->WindowSize = TCP_WINDOW_SIZE;
+ packet->WindowSize = htons(TCP_WINDOW_SIZE);
packet->AcknowlegementNumber = htonl(Connection->NextSequenceRcv);
packet->SequenceNumber = htonl(Connection->NextSequenceSend);