1 | // Copyright (c) 2010 Andreas Faerber <andreas.faerber@web.de>
|
---|
2 | // All rights reserved. Distributed under the terms of the MIT License.
|
---|
3 |
|
---|
4 | using System;
|
---|
5 | using System.Net;
|
---|
6 | using System.Net.Sockets;
|
---|
7 |
|
---|
8 | class Test {
|
---|
9 | static void Main() {
|
---|
10 | TcpListener listener = new TcpListener(IPAddress.Any, 8888);
|
---|
11 | listener.Start();
|
---|
12 | while (true) {
|
---|
13 | Console.Write("Listening...");
|
---|
14 | TcpClient client = listener.AcceptTcpClient();
|
---|
15 | Console.Write("connected to {0}, closing...", client.Client.RemoteEndPoint);
|
---|
16 | client.Close();
|
---|
17 | Console.WriteLine("done.");
|
---|
18 | }
|
---|
19 | }
|
---|
20 | }
|
---|