Re: port issue I think [SuSE] - SOLVED

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
JeepNut
Newbie
Newbie
Posts: 12
Joined: January 9th, 2015, 10:04 pm

Re: port issue I think [SuSE] - SOLVED

Post by JeepNut »

Have asked in the openSuSE forums but no response to this point.
Here's the basic system info:
ASUS A8N32-SLI Deluxe / AMDAthlon(tm) 64x2 4800+ 2.4MHz
Linux 3.16.7-7-desktop / openSUSE 13.2 (Harlequin) (x86_64)
KDE 4.14.3 / WD2500HHTZ-6 Raptor SATA system partition

Never used SABnzbd before but have been using openSuSE since vers. 8.
I'm stuck with trying to run SABnzbd on openSuSE 13.2. Don't seem to be a lot of posts about this so it must be something basic getting by me.
All dependencies, etc. seem fine, and all goes well right up to the point of it starting. Then it chokes on the port. No matter what port I try to use.

Code: Select all

User@MyPC:~/SABnzbd-0.7.20> python SABnzbd.py --server localhost:40000
or port 8080 or whatever your preference.
It always throws up the html page error re: the port being unavailable and shows the next incrementally higher port as a suggestion.
Which never works either.

I don't find the server to be running already in the system monitor.
I've opened the firewall port 8080 and 40000 at alternate times and no change in behavior.
I've dropped the firewall entirely and tried it with no change in behavior.
I've tried modifying the port in advance in the /home/<user>/.sabnzbd.ini file. Was no help.

It seems to ME that the problem is just that the pkg can't use ports and maybe isn't a SABnzbd issue at all.
I'm not aware that it needs to be run as SuperUser, so I won't unless that's what's required.
Here's a snip from the setup log.

Code: Select all

2015-01-09 00:54:49,655::INFO::[__init__:335] All processes started
2015-01-09 00:54:49,655::INFO::[SABnzbd:335] Web dir is /home/<user>/SABnzbd-0.7.20/interfaces/Plush
2015-01-09 00:54:49,655::INFO::[SABnzbd:335] Web dir is /home/<user>/SABnzbd-0.7.20/interfaces/Config
2015-01-09 00:54:49,662::INFO::[SABnzbd:464] _yenc module... found!
2015-01-09 00:54:49,662::INFO::[SABnzbd:472] par2 binary... found (/usr/bin/par2)
2015-01-09 00:54:49,662::INFO::[SABnzbd:480] unrar binary... found (/usr/bin/unrar)
2015-01-09 00:54:49,663::INFO::[SABnzbd:485] unzip binary... found (/usr/bin/unzip)
2015-01-09 00:54:49,663::INFO::[SABnzbd:491] nice binary... found (/usr/bin/nice)
2015-01-09 00:54:49,663::INFO::[SABnzbd:495] ionice binary... found (/usr/bin/ionice)
2015-01-09 00:54:49,663::INFO::[SABnzbd:500] pyOpenSSL... found (True)
2015-01-09 00:54:49,665::INFO::[SABnzbd:1528] Starting web-interface on 127.0.0.1:40000
2015-01-09 00:54:49,666::INFO::[_cplogging:55] [09/Jan/2015:00:54:49] ENGINE Bus STARTING
2015-01-09 00:54:49,669::INFO::[_cplogging:55] [09/Jan/2015:00:54:49] ENGINE Started monitor thread '_TimeoutMonitor'.
2015-01-09 00:54:49,673::ERROR::[_cplogging:55] [09/Jan/2015:00:54:49] ENGINE Error in HTTP server: shutting down
Traceback (most recent call last):
  File "/home/<user>/SABnzbd-0.7.20/cherrypy/process/servers.py", line 75, in _start_http_thread
    self.httpserver.start()
  File "/home/<user>/SABnzbd-0.7.20/cherrypy/wsgiserver/__init__.py", line 1644, in start
    raise socket.error, msg
error: [Errno 99] Cannot assign requested address
etc., etc., etc.
All looks like it's going along swimmingly until it tries to actually start the web interface.
Bus engine starts, then all shuts down after a few seconds.
Hoping there's another openSuSE user that can tell me what I can do to find out what's blocking this puppy from running....

Thanks!
Last edited by JeepNut on January 18th, 2015, 11:34 pm, edited 1 time in total.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: port issue I think [SuSE]

Post by sander »

Interesting. Let's do some tests:

What is the result of:

Basic listen:

Code: Select all

nc -l 40001
Running SAB as root:

Code: Select all

sudo python SABnzbd.py --server localhost:40002
Running this python program:

Code: Select all

# Echo server program
import socket

HOST = '127.0.0.1'                 # Symbolic name meaning all available interfaces
PORT = 40003              # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
    data = conn.recv(1024)
    if not data: break
    conn.sendall(data)
conn.close()
User avatar
jcfp
Release Testers
Release Testers
Posts: 1032
Joined: February 7th, 2008, 12:45 pm

Re: port issue I think [SuSE]

Post by jcfp »

Code: Select all

2015-01-09 00:54:49,665::INFO::[SABnzbd:1528] Starting web-interface on 127.0.0.1:40000
[...]
error: [Errno 99] Cannot assign requested address
Looks like some network setup problem. Is 127.0.0.1 available? Loopback device up? Anything strange in resolv.conf? What happens if you use 0.0.0.0 for the host address? (careful: makes your web interface remotely available)
Root shouldn't be needed for high port numbers (i.e, >=1024).
JeepNut
Newbie
Newbie
Posts: 12
Joined: January 9th, 2015, 10:04 pm

Re: port issue I think [SuSE]

Post by JeepNut »

sander wrote:Interesting. Let's do some tests:

What is the result of:

Basic listen:

Code: Select all

nc -l 40001
This seemed to have created some activity for the system. But the terminal remained blank for more than 10 minutes.
I did ^C to end the process in the terminal.

sander wrote:Running SAB as root:

Code: Select all

sudo python SABnzbd.py --server localhost:40002
Result:

Code: Select all

user@MyPC:~> sudo python SABnzbd.py --server localhost:40002

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

root's password:
python: can't open file 'SABnzbd.py': [Errno 2] No such file or directory
user@MyPC:~> 
Seems odd. I know it's there. Not sure why the system doesn't know it's there.... hmm....
I think this gives me a hint though.... If my feeble mind recalls correctly I think I initially ran through the setup routine with the program folder parked under the path /opt/SABnzbd. Subsequently having issues and considering permissions, I moved the entire folder to a /home/username/SABnzbd path.
Perhaps I need to re-run the installation with it parked where it is now...
sander wrote: Running this python program:

Code: Select all

# Echo server program
import socket

HOST = '127.0.0.1'                 # Symbolic name meaning all available interfaces
PORT = 40003              # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
    data = conn.recv(1024)
    if not data: break
    conn.sendall(data)
conn.close()
seems an unknown command in SuSE

Code: Select all

user@MyPC:~> Echo server program
If 'Echo' is not a typo you can use command-not-found to lookup the package that contains it, like this:
    cnf Echo
user@MyPC:~> 
I'm thinking a re-run through the install process might resolve. Couldn't hurt anyway, right?
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: port issue I think [SuSE]

Post by sander »

Hmmm. It looks like you need more explanation.

But before that: can you try jcfp's suggestion? So

Code: Select all

python SABnzbd.py --server 0.0.0.0:40000
JeepNut
Newbie
Newbie
Posts: 12
Joined: January 9th, 2015, 10:04 pm

Re: port issue I think [SuSE]

Post by JeepNut »

You bet!

Code: Select all

user@MyPC:~> python SABnzbd.py --server 0.0.0.0:40000
python: can't open file 'SABnzbd.py': [Errno 2] No such file or directory
user@MyPC:~>
Seems it's really not able to find the file.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: port issue I think [SuSE]

Post by sander »

JeepNut wrote:You bet!

Code: Select all

user@MyPC:~> python SABnzbd.py --server 0.0.0.0:40000
python: can't open file 'SABnzbd.py': [Errno 2] No such file or directory
user@MyPC:~>
Seems it's really not able to find the file.
Ah. It seems you don't know the concept of a working directory?

Do this:

Code: Select all

cd
cd SABnzbd-0.7.20
python SABnzbd.py --server 0.0.0.0:40000
JeepNut
Newbie
Newbie
Posts: 12
Joined: January 9th, 2015, 10:04 pm

Re: port issue I think [SuSE]

Post by JeepNut »

jcfp wrote:

Code: Select all

2015-01-09 00:54:49,665::INFO::[SABnzbd:1528] Starting web-interface on 127.0.0.1:40000
[...]
error: [Errno 99] Cannot assign requested address
Looks like some network setup problem. Is 127.0.0.1 available? Loopback device up? Anything strange in resolv.conf? What happens if you use 0.0.0.0 for the host address? (careful: makes your web interface remotely available)
Root shouldn't be needed for high port numbers (i.e, >=1024).
I'm on the ragged edge of knowing what I'm doing jcfp. ;)
I'm not sure how to know if 127.0.0.1 is available or if the Loopback device is up or not.
The file resolv.conf doesn't exist anywhere in the system.
JeepNut
Newbie
Newbie
Posts: 12
Joined: January 9th, 2015, 10:04 pm

Re: port issue I think [SuSE]

Post by JeepNut »

sander wrote: Do this:

Code: Select all

cd
cd SABnzbd-0.7.20
python SABnzbd.py --server 0.0.0.0:40000
OK that runs the routine.
Back to the html error page:

Code: Select all

 SABnzbd.py 0.7.20
    SABnzbd needs a free tcp/ip port for its internal web server.
    Port 40000 on localhost was tried , but it is not available.
    Some other software uses the port or SABnzbd is already running.
    Please restart SABnzbd with a different port number.
    Open a Terminal window and type the line (example):
        /home/user/SABnzbd-0.7.20/SABnzbd.py --server localhost:40001

    If you get this error message again, please try a different number.
Program did not start!
Trying each offered port results in the next incremental port number being offered.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: port issue I think [SuSE]

Post by sander »

Can you post the full logging, including the startup?
JeepNut
Newbie
Newbie
Posts: 12
Joined: January 9th, 2015, 10:04 pm

Re: port issue I think [SuSE]

Post by JeepNut »

For sure! I may not know what I'm doing but I can follow instructions.... ;)

Code: Select all

user@MyPC:~/SABnzbd-0.7.20> python SABnzbd.py --server 0.0.0.0:40001
2015-01-11 18:49:51,973::INFO::[SABnzbd:1262] --------------------------------
2015-01-11 18:49:51,973::INFO::[SABnzbd:1263] SABnzbd.py-0.7.20 (rev=1df2943d05d64915a166e2c97e1eef86f72e3ff3)
2015-01-11 18:49:51,974::INFO::[SABnzbd:1275] Platform = posix
2015-01-11 18:49:51,974::INFO::[SABnzbd:1276] Python-version = 2.7.8 (default, Sep 30 2014, 15:34:38) [GCC]
2015-01-11 18:49:51,974::INFO::[SABnzbd:1277] Arguments = SABnzbd.py --server 0.0.0.0:40001
2015-01-11 18:49:51,974::INFO::[SABnzbd:1327] Read INI file /home/user/.sabnzbd/sabnzbd.ini
2015-01-11 18:49:51,976::INFO::[__init__:943] Loading data for bookmarks.sab from /home/user/.sabnzbd/admin/bookmarks.sab
2015-01-11 18:49:51,976::INFO::[__init__:943] Loading data for rss_data.sab from /home/user/.sabnzbd/admin/rss_data.sab
2015-01-11 18:49:51,976::INFO::[__init__:943] Loading data for totals9.sab from /home/user/.sabnzbd/admin/totals9.sab
2015-01-11 18:49:51,976::INFO::[__init__:946] /home/user/.sabnzbd/admin/totals9.sab missing, trying old cache
2015-01-11 18:49:51,977::INFO::[__init__:949] /home/user/.sabnzbd/cache/totals9.sab missing
2015-01-11 18:49:52,096::INFO::[postproc:91] Loading postproc queue
2015-01-11 18:49:52,097::INFO::[__init__:943] Loading data for postproc1.sab from /home/user/.sabnzbd/admin/postproc1.sab
2015-01-11 18:49:52,097::INFO::[__init__:943] Loading data for queue9.sab from /home/user/.sabnzbd/admin/queue9.sab
2015-01-11 18:49:52,098::INFO::[__init__:943] Loading data for watched_data.sab from /home/user/.sabnzbd/admin/watched_data.sab
2015-01-11 18:49:52,098::INFO::[__init__:943] Loading data for Rating.sab from /home/user/.sabnzbd/admin/Rating.sab
2015-01-11 18:49:52,098::INFO::[__init__:946] /home/user/.sabnzbd/admin/Rating.sab missing, trying old cache
2015-01-11 18:49:52,098::INFO::[__init__:949] /home/user/.sabnzbd/cache/Rating.sab missing
2015-01-11 18:49:52,099::INFO::[scheduler:172] Setting schedule for midnight BPS reset
2015-01-11 18:49:52,099::INFO::[downloader:211] Resuming
2015-01-11 18:49:52,106::INFO::[__init__:335] All processes started
2015-01-11 18:49:52,106::INFO::[SABnzbd:335] Web dir is /home/user/SABnzbd-0.7.20/interfaces/Plush
2015-01-11 18:49:52,107::INFO::[SABnzbd:335] Web dir is /home/user/SABnzbd-0.7.20/interfaces/Config
2015-01-11 18:49:52,113::INFO::[SABnzbd:464] _yenc module... found!
2015-01-11 18:49:52,113::INFO::[SABnzbd:472] par2 binary... found (/usr/bin/par2)
2015-01-11 18:49:52,114::INFO::[SABnzbd:480] unrar binary... found (/usr/bin/unrar)
2015-01-11 18:49:52,114::INFO::[SABnzbd:485] unzip binary... found (/usr/bin/unzip)
2015-01-11 18:49:52,114::INFO::[SABnzbd:491] nice binary... found (/usr/bin/nice)
2015-01-11 18:49:52,114::INFO::[SABnzbd:495] ionice binary... found (/usr/bin/ionice)
2015-01-11 18:49:52,114::INFO::[SABnzbd:500] pyOpenSSL... found (True)
2015-01-11 18:49:52,118::INFO::[SABnzbd:1528] Starting web-interface on 0.0.0.0:40001
2015-01-11 18:49:52,121::INFO::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE Bus STARTING
2015-01-11 18:49:52,124::INFO::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE Started monitor thread '_TimeoutMonitor'.
2015-01-11 18:49:52,129::ERROR::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE Error in HTTP server: shutting down
Traceback (most recent call last):
  File "/home/user/SABnzbd-0.7.20/cherrypy/process/servers.py", line 75, in _start_http_thread
    self.httpserver.start()
  File "/home/user/SABnzbd-0.7.20/cherrypy/wsgiserver/__init__.py", line 1644, in start
    raise socket.error, msg
error: [Errno 99] Cannot assign requested address

2015-01-11 18:49:52,130::INFO::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE Bus STOPPING
2015-01-11 18:49:52,130::INFO::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE HTTP Server None already shut down
2015-01-11 18:49:52,130::INFO::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('::1', 40001)) already shut down
2015-01-11 18:49:52,131::INFO::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE Stopped thread '_TimeoutMonitor'.
2015-01-11 18:49:52,132::INFO::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE Bus STOPPED
2015-01-11 18:49:52,132::INFO::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE Bus EXITING
2015-01-11 18:49:52,132::INFO::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE Bus EXITED
Exception in thread HTTPServer Thread-10:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib64/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/user/SABnzbd-0.7.20/cherrypy/process/servers.py", line 75, in _start_http_thread
    self.httpserver.start()
  File "/home/user/SABnzbd-0.7.20/cherrypy/wsgiserver/__init__.py", line 1644, in start
    raise socket.error, msg
error: [Errno 99] Cannot assign requested address

2015-01-11 18:49:52,229::ERROR::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE Error in 'start' listener <bound method ServerAdapter.start of <cherrypy.process.servers.ServerAdapter object at 0x7f62bf909190>>
Traceback (most recent call last):
  File "/home/user/SABnzbd-0.7.20/cherrypy/process/wspbus.py", line 147, in publish
    output.append(listener(*args, **kwargs))
  File "/home/user/SABnzbd-0.7.20/cherrypy/process/servers.py", line 62, in start
    self.wait()
  File "/home/user/SABnzbd-0.7.20/cherrypy/process/servers.py", line 97, in wait
    raise self.interrupt
error: [Errno 99] Cannot assign requested address

2015-01-11 18:49:52,430::INFO::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE Serving on 0.0.0.0:40001
2015-01-11 18:49:52,431::ERROR::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE Shutting down due to error in start listener:
Traceback (most recent call last):
  File "/home/user/SABnzbd-0.7.20/cherrypy/process/wspbus.py", line 184, in start
    self.publish('start')
  File "/home/user/SABnzbd-0.7.20/cherrypy/process/wspbus.py", line 147, in publish
    output.append(listener(*args, **kwargs))
  File "/home/user/SABnzbd-0.7.20/cherrypy/process/servers.py", line 62, in start
    self.wait()
  File "/home/user/SABnzbd-0.7.20/cherrypy/process/servers.py", line 97, in wait
    raise self.interrupt
error: [Errno 99] Cannot assign requested address

2015-01-11 18:49:52,431::INFO::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE Bus STOPPING
2015-01-11 18:49:52,434::INFO::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 40001)) shut down
2015-01-11 18:49:52,434::INFO::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('::1', 40001)) already shut down
2015-01-11 18:49:52,435::INFO::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE No thread running for _TimeoutMonitor.
2015-01-11 18:49:52,435::INFO::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE Bus STOPPED
2015-01-11 18:49:52,435::INFO::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE Bus EXITING
2015-01-11 18:49:52,435::INFO::[_cplogging:55] [11/Jan/2015:18:49:52] ENGINE Bus EXITED
2015-01-11 18:49:52,435::ERROR::[SABnzbd:1543] Failed to start web-interface: 
Traceback (most recent call last):
  File "SABnzbd.py", line 1535, in main
    cherrypy.engine.start()
  File "/home/user/SABnzbd-0.7.20/cherrypy/process/wspbus.py", line 184, in start
    self.publish('start')
  File "/home/user/SABnzbd-0.7.20/cherrypy/process/wspbus.py", line 147, in publish
    output.append(listener(*args, **kwargs))
  File "/home/user/SABnzbd-0.7.20/cherrypy/process/servers.py", line 62, in start
    self.wait()
  File "/home/user/SABnzbd-0.7.20/cherrypy/process/servers.py", line 97, in wait
    raise self.interrupt
error: [Errno 99] Cannot assign requested address
2015-01-11 18:49:52,437::ERROR::[SABnzbd:304] Failed to start web-interface : [Errno 99] Cannot assign requested address
2015-01-11 18:49:52,439::INFO::[panic:247] Lauching browser with /tmp/tmpvpyluf.html
2015-01-11 18:49:52,444::INFO::[__init__:373] SABnzbd shutting down...
2015-01-11 18:49:52,445::INFO::[__init__:919] Saving data for bookmarks.sab in /home/user/.sabnzbd/admin/bookmarks.sab
2015-01-11 18:49:52,445::INFO::[urlgrabber:72] URLGrabber shutting down
2015-01-11 18:49:52,446::INFO::[__init__:919] Saving data for watched_data.sab in /home/user/.sabnzbd/admin/watched_data.sab
2015-01-11 18:49:52,446::INFO::[dirscanner:268] Dirscanner shutting down
2015-01-11 18:49:52,948::INFO::[postproc:85] Saving postproc queue
2015-01-11 18:49:52,948::INFO::[__init__:919] Saving data for postproc1.sab in /home/user/.sabnzbd/admin/postproc1.sab
2015-01-11 18:49:52,948::INFO::[nzbqueue:218] Saving queue
2015-01-11 18:49:52,949::INFO::[__init__:919] Saving data for queue9.sab in /home/user/.sabnzbd/admin/queue9.sab
2015-01-11 18:49:52,950::INFO::[__init__:919] Saving data for rss_data.sab in /home/user/.sabnzbd/admin/rss_data.sab
2015-01-11 18:49:52,950::INFO::[__init__:919] Saving data for bookmarks.sab in /home/user/.sabnzbd/admin/bookmarks.sab
2015-01-11 18:49:52,951::INFO::[__init__:919] Saving data for watched_data.sab in /home/user/.sabnzbd/admin/watched_data.sab
2015-01-11 18:49:52,951::INFO::[postproc:85] Saving postproc queue
2015-01-11 18:49:52,951::INFO::[__init__:919] Saving data for postproc1.sab in /home/user/.sabnzbd/admin/postproc1.sab
2015-01-11 18:49:52,952::INFO::[__init__:440] All processes stopped
user@MyPC:~/SABnzbd-0.7.20> 
JeepNut
Newbie
Newbie
Posts: 12
Joined: January 9th, 2015, 10:04 pm

Re: port issue I think [SuSE]

Post by JeepNut »

Maybe this is what jcfp is referencing?
I ran ifconfig as su and this is part of what came back.

Code: Select all

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:5661 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5661 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:519677 (507.4 Kb)  TX bytes:519677 (507.4 Kb)
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: port issue I think [SuSE]

Post by sander »

Back to the python program. Plus more explanation:

Put the text below into a file echo-test.py. Then run it with "python echo-test.py". Post the the result here.

Code: Select all

# Echo server program
import socket

print "Start"

HOST = '127.0.0.1'                 # Symbolic name meaning all available interfaces
PORT = 40003              # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
    data = conn.recv(1024)
    if not data: break
    conn.sendall(data)
conn.close()
JeepNut
Newbie
Newbie
Posts: 12
Joined: January 9th, 2015, 10:04 pm

Re: port issue I think [SuSE]

Post by JeepNut »

Thanks sander.
Results of that test were that after starting the routine, the terminal screen remained blank for 10 minutes.
So I did ^C to stop the routine
Then it printed the text shown:

Code: Select all

user@MyPC:~/SABnzbd-0.7.20> python echo-test.py
Start

^CTraceback (most recent call last):
  File "echo-test.py", line 11, in <module>
    conn, addr = s.accept()
  File "/usr/lib64/python2.7/socket.py", line 202, in accept
    sock, addr = self._sock.accept()
KeyboardInterrupt
user@MyPC:~/SABnzbd-0.7.20> 
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: port issue I think [SuSE]

Post by sander »

Blank? Or was the text "Start" printed immediately?
Post Reply