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