Skip to content

Commit fbcbda6

Browse files
author
Emile Joubert
committed
Prevent socket error when shutting down
1 parent 006a954 commit fbcbda6

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

projects/client/RabbitMQ.Client/src/client/impl/IFrameHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public interface IFrameHandler
6161
AmqpTcpEndpoint Endpoint { get; }
6262

6363
///<summary>Socket read timeout, in milliseconds. Zero signals "infinity".</summary>
64-
int Timeout { get; set; }
64+
int Timeout { set; }
6565

6666
void SendHeader();
6767

projects/client/RabbitMQ.Client/src/client/impl/SocketFrameHandler_0_9.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,12 @@ public AmqpTcpEndpoint Endpoint
104104

105105
public int Timeout
106106
{
107-
get
108-
{
109-
return m_socket.ReceiveTimeout;
110-
}
111-
set
112-
{
113-
m_socket.ReceiveTimeout = value;
107+
set
108+
{
109+
if (m_socket.Connected)
110+
{
111+
m_socket.ReceiveTimeout = value;
112+
}
114113
}
115114
}
116115

0 commit comments

Comments
 (0)