Thread: How to fix this error for my server code.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2019
    Posts
    1,078
    Quote Originally Posted by Bossuche9 View Post
    yeah i will implement the getnameinfo
    I've show this to you as an example. Don't recommend it because the interfaces names change from system to system... Here, in my machine (Linux), my network card interface is enp3s0, not eth0 (I did some editing in the previous message!) - Virtual machines name their own interfaces in a different way... Containers, like those of docker, also do the same...

    Use 0.0.0.0, as the first example, or inform the desired IP address from command line. It is better. As I said, getting the IP for the NIC isn't portable (each OS do in a different way - I think, but not sure, that code using getnameinfo() will not work on MacOS, for example)...
    Last edited by flp1969; 04-21-2019 at 09:36 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C code along with server
    By santarus in forum Networking/Device Communication
    Replies: 1
    Last Post: 10-22-2011, 09:51 AM
  2. chat server error
    By cute_kuddi in forum Linux Programming
    Replies: 2
    Last Post: 06-09-2011, 10:47 PM
  3. Help with server code !!!
    By Gaurav Singh in forum Networking/Device Communication
    Replies: 5
    Last Post: 03-21-2011, 09:04 AM
  4. X server slaps some template code with a "fatal IO error"
    By Yarin in forum Linux Programming
    Replies: 8
    Last Post: 08-24-2009, 08:47 AM
  5. So this is the code for the client and server
    By Bharat_kumarr in forum C++ Programming
    Replies: 14
    Last Post: 09-09-2004, 10:42 AM

Tags for this Thread