Umesha MS
Umesha MS

Reputation: 2921

Tcp Socket + send() error #10054

I am working on a sample application which sends file to other device. I have 2 buttons on my window, one is to send and other is to stop file transfer. Send; send the file to destination and Stop: stops the sending process.

When I send the multiple files to destination, all files reach destination properly. But if I click send and stop repeatedly for 3 to 4 times (ie initially I click send then suddenly within no time I click stop. I will continue this process for 3 to 4 times). Then if I try to send the multiple files then, it will send first file and when it send the 2 file I get error #10054 in the function Send().

I am using non-blocking socket by: u_long i = 1; ioctlsocket(sockt, FIONBIO, &i);

in the destructer I am closing the scoket.

please help he to solve this problem.

Upvotes: 0

Views: 5523

Answers (1)

Pavel Radzivilovsky
Pavel Radzivilovsky

Reputation: 19114

First, it seems to me like the problem is on the peer end. It may not manage the connections properly. For instance, there might be more than one connection at the time (more than one active socket, like one stopped lingering and a new one just being created) and the other side program not being aware of that.

Upvotes: 1

Related Questions