Sunday, April 23, 2006

What do you do to emulate a server?

So I get one of those typical gardening compalints, "I can't communicate to my server that is running on port 3000...what is wrong?"

Well, first I "netstat -an | grep 3000", looking for a deamon listening on 3000. Nothing. No server, no communication. But I don't know the server software well enough to start it up (custom, not init.d script). So I whip out netcat (could be nc on some platforms) and start it listening as a deamon:

netcat -l -p 3000

netcat listen on port 3000. Any thing netcat recieves will be output to std out. So now from a host that should be able to connect to the server on 3000, "telnet servername 3000". Connected and things type appear on the terminal. Looks good.

Looks the the problem is the server software. Back to your application, developer.

No comments: