Below is link for sample application
http://www.dijksterhuis.org/building-a-tcpip-server-using-c/
It will give you amazing startup code in TCP/IP Communication.
If you are able to connect to the local machine via telnet command not able to connect from another machine then make sure to add exe and port into exception.