Bug #29679 Socket Connection error is occurring.
Submitted: 10 Jul 2007 6:16 Modified: 13 Aug 2007 8:30
Reporter: Pratik Kantharia Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:1.0.7 OS:Any
Assigned to: CPU Architecture:Any

[10 Jul 2007 6:16] Pratik Kantharia
Description:
Hello Sir,

We are using MySql Connector/Net 1.0.7 with ASP.NET (.Net Framework 1.1). We are facing following error continously. 

But we are opening and closing connection in a Ideal way i.e. opening a connection before query execution and closing connection after query is executed. Also we have kept "pooling = false".

Following is the connection string which we are using.

"server=test;user id=test;password=test;database=testDB; pooling=false; allow zero datetime=yes"

/////////////////////////////////////////////
Detailed Error.

Reason :: System.Net.Sockets.SocketException: A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied
at System.Net.Sockets.Socket.Shutdown(SocketShutdown how)
at MySql.Data.Common.SocketStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.BufferedStream.ReadByte()
at MySql.Data.MySqlClient.PacketReader.ReadHeader()
at MySql.Data.MySqlClient.PacketReader.OpenPacket()
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlPoolManager.GetConnection(MySqlConnectionString settings)
at MySql.Data.MySqlClient.MySqlConnection.Open()
at classbased.DAL.BaseDAL.exeScalarQuery(String strQuery) in c:\inetpub\wwwroot\tosc9\classbased\DAL\BaseDAL.vb:line 118

/////////////////////////////////////////////

Please reply asap.. 

How to repeat:
Create a simple application which will fetch record from db. Initialize connection on page load.

Then put a loop of 100 or 1000 and inside the loop perform db operation. Open and Close a connection inside loop. Just try following code snippet..

Dim objConn as MySql.MySqlClient.MySqlConnection
Dim objComm as MySql.MySqlClient.MySqlCommand

Publi Sub Page_Load()

objConn.ConnectionString = "server=test;user id=test;password=test;database=testDB; pooling=false; allow zero datetime=yes"

Dim intI as Integer
Dim intCnt as Integer
Dim strSql as String

For intI = 0 to 100

strSql = "SELECT COUNT(*) FROM PRODUCTS"

objComm.CommandText = strSql
objComm.Connection = objConn
objConn.Open()

intCnt = objComm.ExecuteScalar()

objConn.Close()

Next

End Sub
[13 Jul 2007 8:30] Tonci Grgin
Hi Pratik and thanks for your report. 1.0.7 is rather old version. Is your problem repeatable with latest one?
[13 Aug 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".