Home MySQL trying to resolve event 1026 socket exception on ExecuteReader
Reply: 0

MySQL trying to resolve event 1026 socket exception on ExecuteReader

user2040
1#
user2040 Published in August 15, 2018, 11:15 am

Got a C# application working width MySQL, it worked fine for a whole day. Then the next morning it crashed, width a vague event 1026, which seams to be about about some socket error while doing a ExecuteReader. The MySQL database is on the same machine where the application runs. So i can rule out real network problems, also the query was OK (same queries worked yesterday and after a program restart), but what went wrong after a night of waiting.

It makes me doubt if my connection method is ok. Before i perform a ExecuteReader, i got a simple check command called OpenConnection shown below:

  public void OpenConnection()
    {
        if (MySQLcon.State != System.Data.ConnectionState.Open)
        {
            MySQLcon.Close();
            MySQLcon.Open();
        }
    }

Is above code wrong or not enough ?.

The Windows event 1026 error:

Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Net.Sockets.SocketException
   at System.Net.Sockets.Socket.Send(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)
   at System.Net.Sockets.NetworkStream.Write(Byte[], Int32, Int32)

Exception Info: System.IO.IOException
   at System.Net.Sockets.NetworkStream.Write(Byte[], Int32, Int32)
   at MySql.Data.MySqlClient.TimedStream.Write(Byte[], Int32, Int32)
   at MySql.Data.MySqlClient.MySqlStream.SendPacket(MySql.Data.MySqlClient.MySqlPacket)
   at MySql.Data.MySqlClient.NativeDriver.ExecutePacket(MySql.Data.MySqlClient.MySqlPacket)
   at MySql.Data.MySqlClient.NativeDriver.SendQuery(MySql.Data.MySqlClient.MySqlPacket)
   at MySql.Data.MySqlClient.Driver.SendQuery(MySql.Data.MySqlClient.MySqlPacket)
   at MySql.Data.MySqlClient.Statement.ExecuteNext()
   at MySql.Data.MySqlClient.PreparableStatement.ExecuteNext()
   at MySql.Data.MySqlClient.PreparableStatement.Execute()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(System.Data.CommandBehavior) 
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.303287 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO