Himo Posted July 25, 2005 Posted July 25, 2005 Hi, I'm using WinSock in C# to send some data to a server(duh). The problem is that I have a loop that does some things other then sending data. After some time, about 10-15 times sending, I get this error: An established connection was aborted by the software in your host machine How can I work around this? I know that it probably has something to do with timeouts, but where can I change those settings? Quote For questions about VS .net extensibility, please fire at me! :) For readability, please use the [ CS][/CS ] tags
Administrators PlausiblyDamp Posted July 25, 2005 Administrators Posted July 25, 2005 Any chance you could post the relevant code? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Himo Posted July 25, 2005 Author Posted July 25, 2005 [CS] for(int i = 0; i <= 31; i++ ) { for(int idx=0;idx<16;idx++) { for(int idx2=0;idx2<=i;idx2++) { cookie = //some datatests buffer = "HEAD /PATH HTTP/1.1\r\n"; // buffer += "Host: SERVER\r\n"; buffer += "Cookie: " + cookie + "\r\n"; buffer += "Connection: close\r\n"; buffer += "\r\n"; buffer2 = Encoding.ASCII.GetBytes(buffer); s.Send(buffer2,buffer2.Length,0); //Error above @ s.Send() <-- int counter = 1; while (counter > 0) { counter = s.Receive(bytes, bytes.Length, 0); header = header + Encoding.ASCII.GetString(bytes, 0, counter); } if(header.IndexOf("LOCATION\r\n",0,header.Length) == -1) { //Do Stuff } } } //Reset stuff } [/CS] Quote For questions about VS .net extensibility, please fire at me! :) For readability, please use the [ CS][/CS ] tags
Himo Posted July 28, 2005 Author Posted July 28, 2005 *bumps the topic* Quote For questions about VS .net extensibility, please fire at me! :) For readability, please use the [ CS][/CS ] tags
Administrators PlausiblyDamp Posted August 1, 2005 Administrators Posted August 1, 2005 Out of interest what makes you suspect a timeout is causing the problem? What is running on the remote service (I'm guessing it is a webserver) and are you sure you are sending the correctly formatted requests to it? If you output your requests to a debugger do the ones that break the app still appear to be correct and valid? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.