Conecting TCP client (on linux/c++) to TCP server (on windows c#) [duplicate]

You have to have some sort of name service, such as DNS, in order for gethostbyaddr() to determine the hostname for a given address. There is apparently a problem with this when you are going Windows to linux. In general, I have had a lot of reliability problems myself with resolving hostnames this way and suggest that you not use it. As DTB pointed out, you only need the IP address to connect. If you need the hostname for some other reason, then the safest thing is to have your server send your client its hostname when your client first connects (or vice versa)

Leave a Comment