Showing posts with label systemnetsocketssocketexception. Show all posts
Showing posts with label systemnetsocketssocketexception. Show all posts

Saturday, March 24, 2012

System.Net.Sockets.SocketException: An established connection was aborted by the software

Hello, I got this error today in an Application. This app is coded in asp.net 2, using VB. I have the Andri Code (http://makoto.madmedia.ca/2007/03/mysql-membership-and-role-provider-for.html) to connect asp.net with mysql. It has never caused errors in the past, I have the same configuration on another app that has been running for several months with no problem.

This app is new (1 week) and today is the first day I see this error.

Any ideas?

Server Error in '/' Application.
------------------------

An established connection was aborted by the software in your host machine
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine

Source Error:


Line 859:
Line 860:
Line 861: conn.Open();
Line 862: using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
Line 863: {

Source File: d:\appfolder\App_Code\CSCode\MySQLMembershipProvider.cs Line: 861

Stack Trace:


[SocketException (0x2745): An established connection was aborted by the software in your host machine]
System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) +1019099
MySql.Data.Common.SocketStream.Write(Byte[] buffer, Int32 offset, Int32 count) +22
System.IO.BufferedStream.FlushWrite() +21
System.IO.BufferedStream.Flush() +26
MySql.Data.MySqlClient.MySqlStream.Flush() +119
MySql.Data.MySqlClient.NativeDriver.ExecuteCommand(DBCmd cmd, Byte[] bytes, Int32 length) +114
MySql.Data.MySqlClient.NativeDriver.SetDatabase(String dbName) +29
MySql.Data.MySqlClient.MySqlConnection.ChangeDatabase(String database) +68
MySql.Data.MySqlClient.MySqlConnection.Open() +323
Andri.Web.MySqlMembershipProvider.ValidateUser(String username, String password) in d:\appfolder\App_Code\CSCode\MySQLMembershipProvider.cs:861
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160
System.Web.UI.WebControls.Login.AttemptLogin() +105
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +171
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102


------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.213

Do you have a firewall on your machine? This may be preventing your app from accessing MySQL via TCP/IP.

One other problem where I received this error was when I built a client/server app, and one machine had IPv6 protocol installed but the other machine had IPv4 (same domain/network). When I changed both to IPv4, it worked.


Hello, I have other apps with the same configuration running in the same machine so I think the firewall is not an option.

This is not a standalone app, it is a web app.


Hi vialetti,

I am afraid to say that it seems a bug said from MySql community. Here is link:http://bugs.mysql.com/bug.php?id=6634

Hope this helps. Thanks.

System.Net.Sockets.SocketException when using the HttpWebRequest.GetResponse

Hello i keep gettign this error when i use this code

Error:
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in system.dll

Additional information: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full

Code:

Dim HTTP_request As HttpWebRequest
Dim HTTP_response As HttpWebResponse

HTTP_request = HttpWebRequest.Create("http://www.google.com/images/logo.gif")

HTTP_response = HTTP_request.GetResponse

the erorr happens every time on the "HTTP_response = HTTP_request.GetResponse" line

pls helpanyone pls?
The code works fine for me. Is there a chance you are behind a firewall that is blocking the outgoing call?

Thanks,

AspDotNetGuy
i dont think i block any calls at all, all i have is xp firewall on but when disable that i still get the same error.

now this happens not in all computers, in some just work fine

what kinda trafic should i be looking on this?
Very Odd. I am sure someone has run into this, can someone help? I havne't done much HTML Scraping, so I haven't experienced this before.

What version of .NET your running, maybe something changed in 1.1? No idea just a thought.
Yes is 1.1, I have even reinstalled the framework but nothing. Maybe is something machine related where or like you said some block port. i have to see more of this but man this is driving me crazy.

btw thanks for trying to help i really hope some can give moe some light on this
in case some1 has the same error i got this response in another forum and fixed my problem

This may solve your problem. I had a similar error message but got it when
trying to work with a web service.

First check article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;815209 ; and use the
enum.exe and info to check and/or change your protocol bindings.

If changing your network protocols doesn't work (didn't help me) then get
the hotfix from:
http://support.microsoft.com/default.aspx?scid=kb;en-us;826757

You need to call MS and refer to this article. They may not charge you
anything and will send you the hotfix in a password protected e-mail. The
reason it is not publically available is b/c it is still being regression
tested. I was told it will be a part of the .Net 1.1 service pack which I was
also told should be available this month.

System.Net.Sockets.SocketException when trying to use xml feed

Hi folks, strange error I'm getting here, I'm trying to connect to the ECB s currency exchange feed which is located at

http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml - it looks nice and simple to use.

However my code is throwing a socket exception when I run it from the server and a system.net.webexception - {"The remote server returned an error: (407) Proxy Authentication Required."} when I run it from within visual studio. I had a sample script which took feeds from the BBC site on my home computer which worked fine but it does not work from my office computer so seems like something is up with the server, no?

I've never come across this type of error before myself so is there anyone that can point in the right direction on this one?

Thanks in advance.

Hi,

It seems that the proxy server of your office requires authentication. If you're using a WebClient class to connect to that xml file, make sure you have set the Proxy property. Also, set the Credential property for the Proxy and it will be working fine.