Project

General

Profile

Leginon port already used

Added by Anchi Cheng over 9 years ago

Message from Craig Yoshioka

Have you ever encountered ports 49152-49155 in use already?  The Krios Support PC here already has processes listening on those ports.

What logic does leginon use to find open ports, and can I specify the range in leginon.cfg?

Replies (1)

RE: Leginon port already used - Added by Anchi Cheng over 9 years ago

I have not seen 49152 in used by other services before. Sometimes a previous attempt in socket connection by Leginon does not close properly when it failed, and thus blocking the port. If the python process is killed, it will reopen after a few seconds.

If these standard ports are indeed used by another service, you can change the range. Unfortunately this is not in the configuration file, so you will have to find it in the code.

There are two places datatransport specify port range in the package.
  1. sinedon/tcptransport.py
  2. leginon/tcptransport.py

There should be a line that says something like

  portrange = (49152, 65536)

The logic Leginon uses is just to look for the first available port in the range.

    (1-1/1)