#1 2015-11-18 13:53:46

wuulong
Member
Registered: 2015-10-19
Posts: 3

Quick fix : Control server - server.py

Hi,

        When I run control server on the MAC 10.11. I got some errors related to socket.gethostbyname in the server.py
        Seems this is the useless function. so I just quick fix it like this. Then the USB version of control server works fine for me.
        Hope this information help for others too.
        Wuulong

--------------------------------------
       
    # Print server configurations.
    #ip = socket.gethostbyname(socket.gethostname())
    ip="localhost"
    print '"PLEN - Control Server" is on "%s:%d".' % (ip, args.port)

Offline

#2 2015-11-19 04:54:51

Guvalif
Moderator
From: Osaka / Japan
Registered: 2015-08-31
Posts: 45
Website

Re: Quick fix : Control server - server.py

Hi, wuulong.

Thanks for reporting the issue, and the method which fixes it.
I never saw a bug like the issue, so I interested in when happen the phenomenon.

Would you tell me that the problem is happening even if to call the methods only in your enviroment?
For example, what is a result when running the code below?
```python
# -*- coding: utf-8 -*-
import socket

print socket.gethostname()
print socket.gethostbyname(socket.gethostname())
```

Last edited by Guvalif (2015-11-19 04:55:20)

Offline

#3 2015-11-20 09:59:51

wuulong
Member
Registered: 2015-10-19
Posts: 3

Re: Quick fix : Control server - server.py

I think the problem cause by some wrong configuration of my mac. Maybe caused by DHCP or DNS.
Because the unix command $ping `hostname` can't get the right result.
Suggest to ignore this errors.

Best Regards,

$ python
Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> print socket.gethostname()
wuulong-pro
>>> print socket.gethostbyname(socket.gethostname())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
socket.gaierror: [Errno 8] nodename nor servname provided, or not known


$ hostname
wuulong-pro

$ping `hostname`
ping: cannot resolve wuulong-pro: Unknown host

Offline

Board footer

Powered by FluxBB