Question about sockets in client-server model
Hello! I am a newbie in socket programming, and I wanted to create a client-serve model using sockets in C language. Server is my PC and client is my laptop. I found some example code on the net, but there's something I dont understand and would like to ask. The code i found is available in Linux Howtos: C/C++ -> Sockets Tutorial when I searched it on the net.. Now my question is, when the client says Code: server = gethostbyname(argv[1]); My question is what/where is this database? Is it setup when PC starts using the connection? How can the client query if a server with my PC's hostname exists? Can you plz explain this simply?? PS. can you also explain Code: serv_addr.sin_addr.s_addr = INADDR_ANY; Thanks! |
No comments:
Post a Comment