there something about this tutorial i do not understand. I hope someone can explain to me. http://www.tidytutorials.com/2009/12/c-winsock-example-using-client-server.html
In the server program, it's port was initialised to 1101 (line 14)
13. //The port you want the server to listen on
14. int host_port= 1101;
and in the client program it's port is also 1101
12. //The port and address you want to connect to
13. int host_port= 1101;
14. char* host_name="127.0.0.1";
Now here's the question.
Is the int host_port in client program the same as int host_port inside the server program?
Why is the port number specifically 1101? (i get error 111 when i change the port number to 80 or other number like 1234)
isnt char* host_name="127.0.0.1"; supposed to refer to the client ip address? Why must i specifically use the loopback address and not 192.x.x.x.
Thank you
I realise my mistake, i run my client before the server program......... and in the client program i did not put
serv_addr.sin_addr.s_addr = INADDR_ANY; <<<<<<