Reasons of "An existing connection was forcibly closed by the remote host" ?
Posted by: Pavel Bazanov
Date: July 26, 2010 06:22AM

Hello,
Once in a few days I see System.Net.Sockets.SocketException thrown, saying "An existing connection was forcibly closed by the remote host".

I don't understand the reasons for this exception. Our mysql server is not being shutdown at that time, clients and the server are in the same small local network.

So I want to ask the developers - what are the most probable reasons for this exception?

Here is a stack trace from the logs:


Exception type: System.IO.IOException
Exception message: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.

Inner exception type: System.Net.Sockets.SocketException
Inner exception message: An existing connection was forcibly closed by the remote host

Stack trace:
at MyNetworkStream.HandleOrRethrowException(Exception e)
at MyNetworkStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.TimedStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.SendPacket(MySqlPacket packet)
at MySql.Data.MySqlClient.NativeDriver.ExecutePacket(MySqlPacket packetToExecute)
at MySql.Data.MySqlClient.NativeDriver.SendQuery(MySqlPacket queryPacket)
at MySql.Data.MySqlClient.Driver.SendQuery(MySqlPacket p)
at MySql.Data.MySqlClient.Statement.ExecuteNext()
at MySql.Data.MySqlClient.PreparableStatement.ExecuteNext()
at MySql.Data.MySqlClient.PreparableStatement.Execute()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
at RA.WinForms.CreateBoxForm.SaveToDB(MySqlCommand command) in C:\VCProjects\Alex\RA\RA\WinForms\CreateBoxForm.cs:line 236



I tried to search all over the Internet to understand the reason but with no luck.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.