Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am getting a weird error ,I am creating a winform application in which scanner is scanning an image and uploading it to the remote server, this is working file everywhere ,but we have client in south africa also ,its not working there and while ulpoading image it is giving me error.

unable to read data from the transport connection an existing connection was forcibly closed by remote host


FYI ,Image is creating in KBs so no issue regarding size of image.

Please suggest.
Posted
Updated 30-Sep-19 19:35pm
Comments
Sergey Alexandrovich Kryukov 22-Nov-13 13:47pm    
Address this question to the remote host. Jokes aside: not enough information; it could be anything.
—SA
Asp_Learner 22-Nov-13 14:00pm    
thanks Sergey Alexandrovich Kryukov for reply ,What I thought initially Client side request is created but server is not responding in timely manner and connection become close, is this can be possible?
ZurdoDev 22-Nov-13 14:06pm    
1. Respond to comment so that the user is notified.
2. You'll have to examine the connection between client and server. It seems something is blocking it. Perhaps anti-virus software on client? Bad network connection? Could be many things.
Asp_Learner 22-Nov-13 14:10pm    
I am uploading it by webservice and I can access the url of WebSerivce from that place that mean server is in approach.
ZurdoDev 22-Nov-13 14:10pm    
Yes, a connection exists but something is closing it.

The above problem is solved ,is was occurring due to proxy server ,so I bypassed the proxy server by simple single line code .

C#
System.Net.ServicePointManager.Expect100Continue = false;


just before the service is called.
 
Share this answer
 
Comments
dbnex14 4-Nov-14 12:07pm    
I am getting same error on WindowsMobile 5.0, 6, 6.5
kskumaran 24-Oct-18 1:10am    
Hi friend, where it is located to used?. pls explain ?
Your code has nothing to do with this.

Basically the remote end has terminated the socket. The 'forcibly" just means it was done in an unusual way but it is still the remote end.

If it was me I would start by looking at firewalls. Firewalls can be set to "forcibly" close a socket if it does not meet the criteria of the firewall rule - usually a time limit. And I use "forcibly" specifically there because such a closure would give you exactly the error you are seeing.

You might time how long the connection lasts before the error occurs. If it is, for example, say almost exactly 5 minutes every time and never longer (more than a couple of seconds) then that would be a strong indication that something in the network infrastructure is closing it.
 
Share this answer
 
Comments
Asp_Learner 22-Nov-13 18:03pm    
What I thought initially Client side request is created but server is not responding in timely manner and connection gets close, is this can be possible?
jschell 23-Nov-13 17:00pm    
Then the client would be closing it. But it tells you the server is.

As another suggestion if one side uses SSL and the other doesn't you might see this (although I consider that you would see the exact error less likely to appear for that reason.)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900