Re: [fossil-users] same port in use by concurrent fossil instances
Am 19.03.2015 um 19:36 schrieb Andy Bradford: Thus said Tontyna on Thu, 19 Mar 2015 11:58:40 +0100: Starting several fossil servers with ui increments port from 8080 onwards. Starting several fossil servers with server increments port ditto. Mixing ui and server instances results in double-bound ports. Don't know whether that's a Windows-only issue. This is not a Windows-only behavior. The server does not use any specific IP and in fact uses any (0.0.0.0) as shown in your netstat output. Whereas ui wants to be on 127.0.0.1 to restrict access to the local machine only. 127.0.0.1 is more specific, so your OS allows it (OpenBSD allows it to). There is no double-binding going on here. If you had 10 IP addresses you could have 10 things all listening on port 8080. If you point your browser to 127.0.0.1:8080 you'll get the UI instance. If you point your browser to 192.168.1.10:8080 (or whatever your IP happens to be) I imagine you'll get the server. Andy -- TAI64 timestamp: 4000550b1748 Thank you very much for your explanation. From now on I'll use http://localhost; to display repos served by `fossil ui` and http://computername; to request from `fossil server`. To avoid confusion in the browser (refresh a page with an URL/port that in the meanwhile points to another repo) I could apply clear-cut distinct stylings to my repos. - Tontyna P.S.: The mixed-up communication (aka double-bind) at work involved a server computer having multiple IPs. Will definitely recheck that. ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] same port in use by concurrent fossil instances
Starting several fossil servers with ui increments port from 8080 onwards. Starting several fossil servers with server increments port ditto. Mixing ui and server instances results in double-bound ports. Don't know whether that's a Windows-only issue. Example: When running `fossil server REPO_A` and `fossil ui REPO_B` at the same time both HTTP server instances will listen on port 8080. Experts will tell you that this is impossible and against builtin socket behaviour, bind() or listen() would never ever allow it, but that's what happens: C:\Oblong\fossiltestnetstat -ano | find :8080 TCP0.0.0.0:8080 0.0.0.0:0ABHÖREN 6516 TCP127.0.0.1:8080 0.0.0.0:0ABHÖREN 7312 PID 6516 and PID 7312 listening on 8080. Consequence is that REPO_A isn't accessible via HTTP. All http://localhost:8080/* requests go to the REPO_B server. When you close the REPO_B instance REPO_A magically reappears. I formerly underwent that double-bind-port feature in non-fossil context where -- depending on circumstances only heaven knows -- sometimes the first an sometimes the second server instance responded to requests on the port involved. Our TCP clients experienced funny mixed-up conversations. Seems that double-bind only happens for executables having the same base name (e.g. myTCPserver.exe or fossil.exe, different full paths don't matter). To prevent the double-bind we finally implemented a function PortInUse() which parses the output of `netstat`. Only workaround so far: Avoid ui and server at the same time and/or apply a --port below 8080 to your `fossil server`. - Tontyna ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] same port in use by concurrent fossil instances
On 3/19/15, Tontyna tont...@ultrareal.de wrote: Starting several fossil servers with ui increments port from 8080 onwards. Starting several fossil servers with server increments port ditto. Mixing ui and server instances results in double-bound ports. Don't know whether that's a Windows-only issue. Example: When running `fossil server REPO_A` and `fossil ui REPO_B` at the same time both HTTP server instances will listen on port 8080. Experts will tell you that this is impossible and against builtin socket behaviour, bind() or listen() would never ever allow it, but that's what happens: The combination if IP address and TCP port must be unique. In this case, you have two instances of Fossil listening on the same TCP port, but using a different IP address. The fossil server is listening on the external IP address, apparently, and fossil ui is listening on the loopback address. HTTP requests from other machines should go to fossil server and HTTP requests from the local machine should go to fossil ui. At least that is the way I read this. C:\Oblong\fossiltestnetstat -ano | find :8080 TCP0.0.0.0:8080 0.0.0.0:0ABHÖREN 6516 TCP127.0.0.1:8080 0.0.0.0:0ABHÖREN 7312 PID 6516 and PID 7312 listening on 8080. Consequence is that REPO_A isn't accessible via HTTP. All http://localhost:8080/* requests go to the REPO_B server. When you close the REPO_B instance REPO_A magically reappears. I formerly underwent that double-bind-port feature in non-fossil context where -- depending on circumstances only heaven knows -- sometimes the first an sometimes the second server instance responded to requests on the port involved. Our TCP clients experienced funny mixed-up conversations. Seems that double-bind only happens for executables having the same base name (e.g. myTCPserver.exe or fossil.exe, different full paths don't matter). To prevent the double-bind we finally implemented a function PortInUse() which parses the output of `netstat`. Only workaround so far: Avoid ui and server at the same time and/or apply a --port below 8080 to your `fossil server`. - Tontyna ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users -- D. Richard Hipp d...@sqlite.org ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] same port in use by concurrent fossil instances
Thus said Tontyna on Thu, 19 Mar 2015 11:58:40 +0100: Starting several fossil servers with ui increments port from 8080 onwards. Starting several fossil servers with server increments port ditto. Mixing ui and server instances results in double-bound ports. Don't know whether that's a Windows-only issue. This is not a Windows-only behavior. The server does not use any specific IP and in fact uses any (0.0.0.0) as shown in your netstat output. Whereas ui wants to be on 127.0.0.1 to restrict access to the local machine only. 127.0.0.1 is more specific, so your OS allows it (OpenBSD allows it to). There is no double-binding going on here. If you had 10 IP addresses you could have 10 things all listening on port 8080. If you point your browser to 127.0.0.1:8080 you'll get the UI instance. If you point your browser to 192.168.1.10:8080 (or whatever your IP happens to be) I imagine you'll get the server. Andy -- TAI64 timestamp: 4000550b1748 ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users