[Mono-bugs] Socket
Enrico Bauermeister
EBauermeister@t-online.de
Mon, 6 Jan 2003 19:53:55 +0100
Hi,
the following Code is correct under .NET-SDK from MS, but not in Mono:
namespace EnrBau.Server
{
using System;
using System.Net;
using System.Net.Sockets;
public class Server
{
public static void Main(string[] args)
{
app=new Server();
app.RunApp(args);
}
private void RunApp(string[] args)
{
serverIPEndPoint=new IPEndPoint(IPAddress.Any,1234);
serverSocket=new Socket(AddressFamily.InterNetwork,
SocketType.Stream,
ProtocolType.Tcp);
serverSocket.Bind(serverIPEndPoint);
serverSocket.Blocking=true;
Console.WriteLine("ServerSocket listen on port 1234...");
serverSocket.Listen(0);
clientSocket=serverSocket.Accept();
}
private static Server app;
private IPEndPoint serverIPEndPoint;
private Socket serverSocket;
private Socket clientSocket;
}
}
From mono (linux and windows) i get following errors:
Unhandled Exception: System.Net.Sockets.SocketException: Some sort of w32 error occurred
in (unmanaged) mono(mono_raise_exception+0x20) [0x80bb610]
in (unmanaged) mono(ves_icall_System_Net_Sockets_Socket_Accept_internal+0x4d) [0x80d20b3]
in <0x00013> 00 System.Net.Sockets.Socket:Accept ()
in <0x000f5> 00 EnrBau.Server.Server:RunApp (string[])
in <0x00041> 00 EnrBau.Server.Server:Main (string[])
With .NET-SDK from MS this code accept a connection to port 1234.
What is false? Is this is bug of mono?
Enrico