Can't bind socket port in use

Moderators: Site Moderators, FAHC Science Team

Post Reply
dscreen
Posts: 10
Joined: Thu Apr 08, 2010 2:52 pm

Can't bind socket port in use

Post by dscreen »

I am running a Macbook Pro with High Sierra. When I run FAHclient....it can't bind the socket saying the port is in use In this case the ports are 36330 for the advanced control and port 7396 for the web control. The client does run and process WU's....but I can't use the advanced control or web control...they don't connect to the client.

The only work around I have found is to run:

fahclient --command-port 36331 --http-addresses 0:7397

Changing the default ports. The web control and advanced controls work with this setup.

Why can't fahclient bind sockets when using the default ports? I only have one client running...not two.
Even rebooting the computer does not release the sockets.
Netstat -a shows TCP in listening mode on those ports not Time-Wait

Thank you. I have Googled this issue and can't find a working solution
Joe_H
Site Admin
Posts: 7870
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: Can't bind socket port in use

Post by Joe_H »

I am currently posting from a MacBook Pro running High Sierra, and have not run into this problem. Have you used the normal install?

The other things that might change how things work are if you have a firewall or other anti-malware measures running.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
dscreen
Posts: 10
Joined: Thu Apr 08, 2010 2:52 pm

Re: Can't bind socket port in use

Post by dscreen »

I have turned off my mac firewall and router firewall...no luck with the socket binding issue. No anti-malware running. Ran the normal install from the pkg file.
Even un-installed the client and reinstalled. Still won't bind the sockets...saying the default ports of 36330 and 7396 are in use.
Joe_H
Site Admin
Posts: 7870
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: Can't bind socket port in use

Post by Joe_H »

With a normal install there will be a process running in the background for FAHClient. Can you see one using Task Manager and setting it to All Processes?
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
dscreen
Posts: 10
Joined: Thu Apr 08, 2010 2:52 pm

Re: Can't bind socket port in use

Post by dscreen »

I use Activity Monitor....Task Manager I believe is Windows. FAHClient runs as an activity and restarts itself even if I force quit it.
Joe_H
Site Admin
Posts: 7870
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: Can't bind socket port in use

Post by Joe_H »

That is the way it is supposed to work, FAHClient is a background process that FAHControl and Web Control communicate with for monitoring and controlling the client. Were you trying to run FAHClient from the command line?

If so, that is why the ports were already in use, they are assigned to FAHClient in the background. When nothing is being done, FAHClient uses almost no resources. If needed, FAHClient can be stopped and restarted from the command line using launchctl, but that is rarely necessary.

You can use Web Control for basic configuration and starting and stopping folding. FAHControl can be used for that and more extensive configuration than the basics available in Web Control.

If you can describe what you are trying to do, we can provide some pointers.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
dscreen
Posts: 10
Joined: Thu Apr 08, 2010 2:52 pm

Re: Can't bind socket port in use

Post by dscreen »

I was running fahclient from the command line.
You are correct. I finally was able to kill the FAHClient process that kept restarting itself. I used this command:
sudo launchctl unload /Library/LaunchDaemons/org.foldingathome.fahclient.plist
It killed the extra process and now fahclient works with the default ports. I will use the Web Control to start and stop it from now on.
Thank you for your help!
bruce
Posts: 20910
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: Can't bind socket port in use

Post by bruce »

I'm curious. Why do you need to replace the FAHClient daemon with one you start manually? Do you do the same for other background services?
dscreen
Posts: 10
Joined: Thu Apr 08, 2010 2:52 pm

Re: Can't bind socket port in use

Post by dscreen »

In my case...I somehow managed to have a process called FAHclient (caps for FAH) running and could not be killed with the mac's Activity Monitor. This process was not working with web control or the advanced control and was using the default ports of 36330 and 7396. After killing the bad process with the launchctl unload command mentioned above....I can now run Web control to start the daemon the correct way. For some reason there is a difference in the two process names....the bad one was FAHclient (caps for FAH) and the good one now is fahclient....small case...
Thank you to Joe for pointing me in the right direction. I was starting the client from a terminal window....which is incorrect.
bruce
Posts: 20910
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: Can't bind socket port in use

Post by bruce »

Well, I don't run a Mac so disregard anything I say that sounds stupid and pay attention to Joe_H.

My universal test to figure out if FAHClient (or fahclient) is functional is to connect to it with telnet. (I presume you have a telnet application or can get one.)

telnet 127.0.0.1 36330 from a text screen should get a response. From that point I ususally enter "help" and/or "quit"

FAHControl basically makes the same connection and there's no port conflicts unless you try to start another program that also tries to manage that same port. (You can't have two FAH command servers which is why I asked you why you wanted to run a different one that the one that gets started when you install it.)
Post Reply