Sockets donot send any thing to client

I have written a socket program in C under RedHat Linux 6.2. This program is using SOCK_STREAM (TCP) to connect to any ip address at port # 23. The program is hosted on the linux machine and works well with Cisco routers. But when I am trying to connect to the same linux machine, it does not return any thing. I have checked my hosts.allow and hosts.deny files. They don't have any restrictions. I am able to use telnet client to login to my linux server.

Can any one help me sort this out ?

The first step is to set up a sniffer and to look at what is happening across the network during the client-server transaction. After you do this, the problem area should be clear and the solution much easier.

Both the client and server are running in the same computer, while reading from the socket, it is getting struck up at some point and does not move forward. But while I am connecting to my cisco router, it is working fine. It reads all the characters with escape sequence and then my motd messages. It reads only the escape characters and then stops when I am connecting to my RedHat Linux server. My socket uses port no 23 with TCP SOCK_STREAM.

Regards

how about figuring out whether your computer is running the telnet service. check your inetd configuration.

also check whether you loopback connection is up.

thx.
qodoc

Yes, my telnetd is working fine, I have checked it from the same computer as well as from another computer in the network. The same linux machine is running name service too which is running fine.

Regards