Problem with Winsock & Server Closing Connection
Problem with Winsock & Server Closing Connection
Problem with Winsock & Server Closing Connection
Problem with Winsock & Server Closing Connection
Problem with Winsock & Server Closing Connection
Problem with Winsock & Server Closing Connection Problem with Winsock & Server Closing Connection Problem with Winsock & Server Closing Connection Problem with Winsock & Server Closing Connection Problem with Winsock & Server Closing Connection Problem with Winsock & Server Closing Connection Problem with Winsock & Server Closing Connection Problem with Winsock & Server Closing Connection
Problem with Winsock & Server Closing Connection Problem with Winsock & Server Closing Connection
Problem with Winsock & Server Closing Connection
Go Back  Xtreme Visual Basic Talk > > > Problem with Winsock & Server Closing Connection


Reply
 
Thread Tools Display Modes
  #1  
Old 06-19-2013, 04:43 PM
IanB53 IanB53 is offline
Newcomer
 
Join Date: Jun 2013
Posts: 3
Default Problem with Winsock & Server Closing Connection


Hi,
I have a legacy VB6 application that has been in use for many years. For the vast majority of users it works just fine but for a small number it does not and I can't figure out why.
Part of the application connects to a website using a Winsock. It sends an amount of data (about 10k) via a Post command, the server examines it and sends back a single, fairly short (less than 1k) reply. Occasionally it sends back a much longer reply (about 100 k), again by a single send although this is received by the application as many (can be around 30) packets which it appends together and then actions (I've assumed this is TCP splitting it up). After sending everything the server always closes the connection.

Occasionally, when it is receiving it's large data reply, the application receives a few packets and then it gets a connection closed event before all the data is received. I have checked the Bytesreceived value (which I think is the amount of data sitting in the Winsock buffer) at the time the close event is received and so far it is always zero but the server sends all the data as a single send and the application has not received it all. As I said, this only affects a small number of users but once they get this problem it seems to happen every time for them, so far it hasn't happened for me which makes it difficult to test.

Can anyone suggest why this could be happening? Even better can anyone suggest how to stop it happening or how to receive the missing data?

One addendum (sorry to go on so much!). When the app gets the connection closed event it currently checks for complete data and gives up if not everything has been received. I do not know if it's valid at that point to simply keep waiting to see if more data arrives, how long to wait etc.

Thanks
Ian
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Problem with Winsock & Server Closing Connection
Problem with Winsock & Server Closing Connection
Problem with Winsock & Server Closing Connection Problem with Winsock & Server Closing Connection
Problem with Winsock & Server Closing Connection
Problem with Winsock & Server Closing Connection
Problem with Winsock & Server Closing Connection Problem with Winsock & Server Closing Connection Problem with Winsock & Server Closing Connection Problem with Winsock & Server Closing Connection Problem with Winsock & Server Closing Connection Problem with Winsock & Server Closing Connection Problem with Winsock & Server Closing Connection
Problem with Winsock & Server Closing Connection
Problem with Winsock & Server Closing Connection
 
Problem with Winsock & Server Closing Connection
Problem with Winsock & Server Closing Connection
 
-->