Hi
I opened a connection a server in the following way
SOCKADDR_IN SockAddr;
SockAddr.sin_port=htons(445);
SockAddr.sin_family=AF_INET;
SockAddr.sin_addr.s_addr=*((unsigned long*)host->h_addr);
// Attempt to connect to server
if(connect(Socket,(SOCKADDR*)(&SockAddr),sizeof(SockAddr))!=0)
{
printf("Failed to establish connection with server\r\n");
WSACleanup();
system("PAUSE");
return 0;
}
Then I try to send data over the TCP connection as follows:
unsigned char completePacket[100] = something;
send(Socket, (char *) completePacket, 100, 0);
This works fine for 2 times,but the third time it seems as if the packet is not sent... Do I need to flush the sockts after each sent or reset them in some way?
Thanks