[Swingosc-devel] sclang udp port choice (was: Re: [sc-users] OSC first-timer problem)
Brought to you by:
sciss
From: nescivi <ne...@gm...> - 2010-06-23 15:09:23
|
On Wednesday 23 June 2010 08:29:48 Jonatan Liljedahl wrote: > James Harkins wrote: > > On 6/23/10 9:35 AM, da...@da... wrote: > >> 2. python needs to be told to OSC.OSCClient().connect to the > >> (localhost-ip, NetAddr.langPort) but each time SC restarts it seems to > >> have a different langport. How can python find out the langport > >> dynamically so the routine can work correctly without needing to being > >> recoded? Should I just write the number to a file, or is there an > >> elegant way to do it? > > > > Oh, PS... this is odd. sclang should be on 57120 by default. If it's > > choosing a different port each time, maybe one sclang process hasn't > > released the port before the next one starts? > > This happens to me sometimes on linux, very frustrating. > > You can see what process is holding the port with this terminal command > (not sure it exists on MacOSX): > > $ lsof -i :57120 ah, useful! First run of sclang with SwingOSC: pantometheus% lsof -i :57120 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME sclang 3247 nescivi 3u IPv4 42848 0t0 UDP *:57120 sh 3280 nescivi 3u IPv4 42848 0t0 UDP *:57120 java 3282 nescivi 3u IPv4 42848 0t0 UDP *:57120 After recompile, SwingOSC keeps running, sclang picks a new port: pantometheus% lsof -i :57120 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME sh 3280 nescivi 3u IPv4 42848 0t0 UDP *:57120 java 3282 nescivi 3u IPv4 42848 0t0 UDP *:57120 pantometheus% lsof -i :57121 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME sclang 3304 nescivi 3u IPv4 44127 0t0 UDP *:57121 I'm not sure what the "sh" process is and why it has taken the UDP port... Killing it makes no difference though (keeping SwingOSC running again, and recompiling): pantometheus% lsof -i :57121 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME sclang 3365 nescivi 3u IPv4 45495 0t0 UDP *:57121 pantometheus% lsof -i :57120 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 3282 nescivi 3u IPv4 42848 0t0 UDP *:57120 The curious thing is that SwingOSC is supposed to use TCP on port 57131 (that's the number I set it to, default is 57111). So what could cause java to open up 57120? hmm... this seems to happen here (SwingOSC)? bootServerApp { var cmd, localAddr; // note : the -h option is used again because it significantly speeds // up the connection. localAddr = NetAddr.localAddr; cmd = java + (options.javaOptions ? "") + "-jar \"" ++ program ++ "\" " ++ options.asOptionsString( addr.port ) + ("-h " ++ localAddr.ip ++ ":" ++ localAddr.port); ("booting " ++ cmd).inform; unixCmd( cmd ); } sincerely, Marije |