SocketException : Only one usage of each socket address (protocol/network address/port) is normally permitted
Posted by: Harleen Kaur
Date: January 17, 2019 07:19AM

I am facing the following error intermittently for my web application. We are using MySql.Data.dll version 6.9.8 and MySqlConnection class.

Error Stack Trace:
MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts. ---> System.Net.Sockets.SocketException (0x80004005): Only one usage of each socket address (protocol/network address/port) is normally permitted XXX:XXX:XX:XX:3306
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at MySql.Data.Common.MyNetworkStream.CreateSocketStream(MySqlConnectionStringBuilder settings, IPAddress ip, Boolean unix)
at MySql.Data.Common.MyNetworkStream.CreateStream(MySqlConnectionStringBuilder settings, Boolean unix)
at MySql.Data.Common.StreamCreator.GetStream(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool..ctor(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPoolManager.GetPool(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlConnection.Open()

Connection String Used :
<connstring encrypted="true"> Server=XXXX;Database=XXX;Uid=XXX;Pwd=XXX;Pooling=true;MinimumPoolSize=1;maximumpoolsize=50;ConnectionLifeTime=0;default command timeout=1200;Allow User Variables=True</connstring>

We have already tried changing the max/min pool size but with no results. The issue reoccurs.

Any help will be highly appreciated. I am totally stuck here. Unable to find relevant answers online for this socket exception error.

Thanks.

Options: ReplyQuote


Subject
Written By
Posted
SocketException : Only one usage of each socket address (protocol/network address/port) is normally permitted
January 17, 2019 07:19AM


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.