I have started reading the book Unix Network Programming, Volume 1: The Sockets Networking API. I downloaded all the source code and performed all the steps present in README file.Now when i compile my first program it give the following error.
sainandan@nandan:~/unpv13e/intro$ ./daytimetcpcli 127.0.0.1
connect error: Connection refused
Well, the target IP address you have given is the local host, 127.0.0.1 so that will come back to your own machine, but what port is your program connecting to? You will need to check that you have a server process listening to that port on either 127.0.0.1 or generally on all ports.
The output from netstat -na | grep LISTEN may help you see what is actually being listened for before you try to connect.
Can you share the code so someone (probably with more skill than I) can comment?
Thanks, in advance,
Robin