Is it possible to use TCPclient and TCPlistener in c# with public IP addresses (or outside my LAN)? If NAT randomly assigns port number to each LAN communication, is there any way to know what port-number will be assigned to TCPlistener by its NAT-router to make TCPclient be able to communicate with it. P.S. If it's not possible is there any other tool/technique to communicate outside the LAN without reconfiguring router (to forward all the messages to TCPlistener)?
Have a look at
TcpListener.AllowNatTraversal
This can be done with Toredo, 6to4, or an ISATAP tunnel.
Another option is UPnP if your NAT device supports it.