Hi guys,
I am doing a TCP/IP time server/client. I already wrote the two programs but when I run them I don't get any output. Simply, the idea is the client asks the server for Time or Date and the server has to respond and terminate after the second request.
On the server side, I have to print the server IP, port, request type and finally the client IP and port.
On the client side, I have to print the client port, server's port, server's IP and the time or date.
I used this code to run the programs:
gcc -o serv server.c -lsocket -lnsl -lresolv
gcc -o cli client.c -lsocket -lnsl -lresolv
One more thing, this is my first time to write socket codes so i have a problem with finding the client port so please I'd appreciate any help.
Thanks :-)
server.c
client.c