OpenAsync throws "System.Net.Sockets.SocketException: Broken pipe"
See original GitHub issueSometimes i’m receiving SocketException when calling _con.OpenAsync(cancellationToken).
Follow the stack:
MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts. ---> System.Net.Sockets.SocketException: Broken pipe
at MySql.Data.SocketAwaitable.GetResult()
at MySql.Data.Protocol.Serialization.SocketByteHandler.<DoWriteBytesAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask`1.get_Result()
at MySql.Data.ValueTaskExtensions.ContinueWith[T,TResult](ValueTask`1 valueTask, Func`2 continuation)
at MySql.Data.Protocol.Serialization.ProtocolUtility.WritePacketAsync(IByteHandler byteHandler, Int32 sequenceNumber, ArraySegment`1 contents, IOBehavior ioBehavior)
at MySql.Data.Protocol.Serialization.ProtocolUtility.WritePayloadAsync(IByteHandler byteHandler, Func`1 getNextSequenceNumber, ArraySegment`1 payload, IOBehavior ioBehavior)
at MySql.Data.Serialization.MySqlSession.TryAsync[TArg](Func`3 func, TArg arg, IOBehavior ioBehavior, CancellationToken cancellationToken)
at MySql.Data.Serialization.MySqlSession.SendAsync(PayloadData payload, IOBehavior ioBehavior, CancellationToken cancellationToken)
at MySql.Data.Serialization.MySqlSession.<TryPingAsync>d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MySql.Data.MySqlClient.ConnectionPool.<GetSessionAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MySql.Data.MySqlClient.MySqlConnection.<CreateSessionAsync>d__57.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MySql.Data.MySqlClient.MySqlConnection.<OpenAsync>d__11.MoveNext()
--- End of inner exception stack trace ---
at MySql.Data.MySqlClient.MySqlConnection.<OpenAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Maybe await SendAsync(PingPayload.Create(), ioBehavior, cancellationToken).ConfigureAwait(false)
; should be inside try catch to?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Socket with .NET Core 3.1: Connection breaks running on ...
Unhandled exception. System.Net.Sockets.SocketException (32): Broken pipe at System.Net.Sockets.Socket.Send(Byte\[\] buffer) at OnkyoEiscp.
Read more >How to fix java.net.SocketException: Broken pipe?
I am using apache commons http client to call url using post method to post the parameters and it is throwing the below...
Read more >Untitled
... OpenAsync throws "System.Net.Sockets.SocketException: Broken pipe" - GitHub WebApr 18, 2017 · An unhandled exception occurs when the application code ...
Read more >Untitled
NET Provider for SQL Server https://www.qfs.de/en/qf-test-manual/lc/manual-en-exceptions.html OpenAsync throws "System.Net.Sockets.SocketException: Broken …
Read more >(NOT SOLVED) java.net.SocketException: Broken pipe
Hello, In my app I'm trying to send a flac file to google for speech recognition. I'm using a thread to do the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Broken pipe typically occurs either when you either unplug a network cable or encounter a NAT timeout. This happens because the server has closed the connection and sent a TCP
FIN
packet, but the client never got theFIN
packet.Since the client still thinks the connection is open, it continues the TCP conversation with the server from where it left off. The server has closed the connection already though, so it sends a
RST
packet. This causes a broken pipe exception.It’s most likely NAT timeout or your network is going away and then coming back.
we do not use nat, but physical host with static ip , the latest version does not fix too
mysql conn string is
@caleblloyd