public ServerContext(int port, int maxclients, ref List<string> TextStack, string OwnIP)
{
BeginSendUdpServerCallback = new AsyncCallback(OnBeginSendUdpServerCallbackFinished);
ServerMessage = System.Text.Encoding.ASCII.GetBytes("OK:" + OwnIP);
UdpServer = new UdpClient(new IPEndPoint(IPAddress.Any, 8011)); //da bei xp fehler
UdpServer.JoinMulticastGroup(BroadcastServer.Address);
UdpServer.BeginSend(ServerMessage, ServerMessage.Length, BroadcastServer, BeginSendUdpServerCallback, null);
MaxClients = maxclients;
Ip = IPAddress.Any;
this.Port = port;
listener = new TcpListener(Ip, Port);
Clients = new List<ClientContext>(MaxClients);
listener.Start();
BeginAcceptSocketCallback = new AsyncCallback(OnClientConnected);
this.TextStack = TextStack;
}