It's recommended to use StreamSocket class instead.
Here is an Example from MSDN.
A socket provides send and receive over TCP and a StreamSocketListener will listen for incoming TCP connections.
Here is my Idea:
First we need a Instance of StreamSocketListener.
private StreamSocketListener _listener = new StreamSocketListener();
Then start the listener wire up a connection received event handler and bind the service name.
_listener.ConnectionReceived += listenerConnectionReceived;
await _listener.BindServiceNameAsync("localServiceName");
If the localServiceName parameter is an empty string, then the system will select the local TCP port on which to bind. MSDN
Now we have to recive the Connection:
void listenerConnectionReceived(StreamSocketListener sender, StreamSocketListenerConnectionReceivedEventArgs args)
{
Console.WriteLine(string.Format("Recive connection from {0}", args.Socket.Information.RemoteHostName.DisplayName));
}
BTW: I did a lot of research for this and haven't time left (and a Windows 8 METRO Development Environment) to prof my ideas. Hope i get soon to this. It really bugs me. (German/English) ;)