Monday 28 August 2006

netstat

Note: The RichText blog has moved to www.ricroberts.com

Yesterday, I was having problems starting my Ruby on Rails server on port 3000. This morning, I discovered the netstat utility that comes with windows.

netstat -a -b
gives you a list of all running programs along with what port they're using and their process id.

This helped me to find out what was hogging port 3000. In my case the offending process was wcescomm.exe, which is to do with the Windows ActiveSync program, and just removing my PDA from it's dock released the port.

If this doesn't solve it for you, you can use taskkill to forcibly terminate a process. For example, to kill off process id 2420:
taskkill /f /pid 2420



Digg Technorati del.icio.us Stumbleupon Reddit Blinklist Furl Spurl Yahoo Simpy

Please also visit the Swirrl blog

5 comments:

Anonymous said...

Thanks so much for posting this! This error had been driving me crazy for the past three days when I wanted to try out Ruby on Rails.

Richard Roberts said...

No worries, Mr Anonymous.

I've been a bit quiet on the blog front recently, but there'll be more soon!

Anonymous said...

Thanks for posting this...this was driving me crazy and it was actually preventing my debugger from starting. Now my debugger starts, I can see things getting pulled from webrick but I cannot put any breakpoints.

Richard Roberts said...

Hi bernie,

I'm pretty sure that it is a port conflict problem.

Have you checked that you've not already got another (webrick) server running on that port? Or if you're debugging, that the port on which the debugger is listening is not already used?

Richard Roberts said...

Hello again bernie,

That's interesting - I always tend to use an external browser anyway so never noticed that problem.

Regarding your question...
You can view variables when you're in the debug view by highlighting a variable or expression in your code window, right-clicking and choosing 'Inspect'. The contents will appear in the expression window.