[Mono-list] 18-Nov-2001 build broken + TcpListener.AcceptTcpClient() problem + Bug report

Phillip Pearson pp@myelin.co.nz
Mon, 19 Nov 2001 22:22:22 +1300


Hi,

Three things:

1 --- Broken snapshot ---

Are the class libraries broken in the 18-Nov-2001 snapshot?  I get errors in
corlib/System/MonoType.cs and corlib/System.Text/Encoding.cs

MonoType.cs gives heaps of errors; I've just rm'd it to get my build going
here.  However, Encoding.cs seems to just have two typos, which can be fixed
with the following:

line 18:
    private static UTF7Encoding utf7_encoding;

line 121:
    utf7_encoding = new UTF7Encoding();

(replace Utf7_Encoding with UTF7Encoding in both cases)



2 --- Implementing Tcp{Client, Listener} ---

I'm trying to implement System.Net.Sockets.TcpClient and .TcpListener.
These don't appear to be in the spec, but are working fine in my copy of
Beta 2, so presumably we want to implement them.

I've written everything except for one method -
TcpListener.AcceptTcpClient(), which is meant to accept an incoming
connection (à la accept() from BSD sockets) and return it, encapsulated in a
TcpClient object.  However, I can't figure out how to set the
TcpClient.Client property properly -- it's protected, but even if I declare
TcpListener derived from TcpClient, I can't get at it.

The files in their current state can be found at
http://www.myelin.co.nz/mono/

Can anyone help me here?  I'd like to be able to say "friend class
TcpListener" but I don't think C# has anything like that ...



3 --- Bug report for System.Net.IPAddress ---

My test cases compile with the class libraries from Beta 2, but not in the
mcs/class tree yet due to a couple of dependencies.  First, one in
System.Net/IPAddress.cs (I think the filename is missing a 'd' -
'IPAdress.cs'):

    error CS0117: 'System.Net.IPAddress' does not contain a definition for
'Any'

This (and a bit more) can be fixed by adding the following lines somewhere
in System/System.Net/IPAdress.cs:

    public static readonly IPAddress Any;
    public static readonly IPAddress Broadcast;
    public static readonly IPAddress Loopback;
    public static readonly IPAddress None;

I'm not sure if you need to assign these to Inaddr{Any, Broadcase, Loopback,
None} or not ...

------

Cheers,
Phillip.