[Mono-list] Patch for TcpClient/TcpListener

Jaroslaw Kowalski jarek@atm.com.pl
Fri, 17 May 2002 08:23:39 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0007_01C1FD7C.25BB79E0
Content-Type: text/plain;
	charset="iso-8859-2"
Content-Transfer-Encoding: 7bit

There's a problem with the TcpClient object returned from
TcpListener.AcceptTcpClient.
When you attempted to call GetStream() on the result you'd get null instead
of the correct NetworkStream object.

Attached is the patch for it. It modifies internal void SetTcpClient() to
correctly initialize "stream" member.
ChangeLog is also included.

Can you add it to CVS?

Jarek

------=_NextPart_000_0007_01C1FD7C.25BB79E0
Content-Type: text/plain;
	name="patch0.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="patch0.txt"

Index: ChangeLog=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /mono/mcs/class/System/System.Net.Sockets/ChangeLog,v=0A=
retrieving revision 1.8=0A=
diff -u -r1.8 ChangeLog=0A=
--- ChangeLog	24 Apr 2002 08:39:24 -0000	1.8=0A=
+++ ChangeLog	17 May 2002 06:21:06 -0000=0A=
@@ -1,3 +1,8 @@=0A=
+2002-05-17  Jaroslaw Kowalski <jarek@atm.com.pl>=0A=
+	* TcpClient.cs: fixed SetTcpClient so that=0A=
+	TcpListener.AcceptTcpClient works and allows=0A=
+	you to call GetStream() on its result=0A=
+=0A=
 2002-04-24  Dick Porter  <dick@ximian.com>=0A=
 =0A=
 	* Socket.cs (Poll): Give correct argument to Select(), as spotted=0A=
Index: TcpClient.cs=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /mono/mcs/class/System/System.Net.Sockets/TcpClient.cs,v=0A=
retrieving revision 1.3=0A=
diff -u -r1.3 TcpClient.cs=0A=
--- TcpClient.cs	6 Jan 2002 10:58:38 -0000	1.3=0A=
+++ TcpClient.cs	17 May 2002 06:21:06 -0000=0A=
@@ -92,7 +92,7 @@=0A=
 		protected Socket Client=0A=
 		{=0A=
 			get { return client; }=0A=
-			set { client =3D value; } //TODO: should we be able to set the =
socket like this?=0A=
+			set { client =3D value; }=0A=
 		}=0A=
 =0A=
 		/// <summary>=0A=
@@ -103,7 +103,8 @@=0A=
 		/// <param name=3D"s"></param>=0A=
 		internal void SetTcpClient (Socket s) =0A=
 		{=0A=
-			Client =3D s; // client or Client?  They are the same at the moment=0A=
+			client =3D s;=0A=
+			stream =3D new NetworkStream(client, true);=0A=
 		}=0A=
 		=0A=
 		/// <summary>=0A=

------=_NextPart_000_0007_01C1FD7C.25BB79E0--