Explorar el Código

2009-08-24 Atsushi Enomoto <[email protected]>

	* TcpDuplexSessionChannel.cs : check channel state before processing
	  Send and Receive.


svn path=/trunk/mcs/; revision=140474
Atsushi Eno hace 16 años
padre
commit
dfdea80b4f

+ 5 - 0
mcs/class/System.ServiceModel/System.ServiceModel.Channels/ChangeLog

@@ -1,3 +1,8 @@
+2009-08-24  Atsushi Enomoto  <[email protected]>
+
+	* TcpDuplexSessionChannel.cs : check channel state before processing
+	  Send and Receive.
+
 2009-08-20  Atsushi Enomoto  <[email protected]>
 
 	* NamedPipeReplyChannel.cs, NamedPipeRequestChannel.cs,

+ 6 - 0
mcs/class/System.ServiceModel/System.ServiceModel.Channels/TcpDuplexSessionChannel.cs

@@ -135,6 +135,8 @@ namespace System.ServiceModel.Channels
 		
 		public override void Send (Message message, TimeSpan timeout)
 		{
+			ThrowIfDisposedOrNotOpen ();
+
 			if (timeout <= TimeSpan.Zero)
 				throw new ArgumentException (String.Format ("Timeout value must be positive value. It was {0}", timeout));
 
@@ -162,6 +164,8 @@ namespace System.ServiceModel.Channels
 		
 		public override Message Receive (TimeSpan timeout)
 		{
+			ThrowIfDisposedOrNotOpen ();
+
 			if (timeout <= TimeSpan.Zero)
 				throw new ArgumentException (String.Format ("Timeout value must be positive value. It was {0}", timeout));
 			client.ReceiveTimeout = (int) timeout.TotalMilliseconds;
@@ -187,6 +191,8 @@ namespace System.ServiceModel.Channels
 		
 		public override bool WaitForMessage (TimeSpan timeout)
 		{
+			ThrowIfDisposedOrNotOpen ();
+
 			if (client.Available > 0)
 				return true;