Skip to content

Commit

Permalink
remove wrong version of duplicate get_local_ip function
Browse files Browse the repository at this point in the history
wrong version was being called; didn't work.
  • Loading branch information
tmills authored Dec 9, 2017
1 parent df56ab7 commit 9f10ae5
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions scripts/PyzmqWorker.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ import GaussianObservationModel
import models
from WorkDistributerServer import get_local_ip

## This function was required because of some funkiness on ubuntu systems where reverse dns lookup was returning a loopback ip
## This will try the easy way and if it returns something with 127. will make an outside connectino to known DNS (8.8.8.8) and
## grab the external IP from that socket.
## Solution from here: http://stackoverflow.com/a/1267524
def get_local_ip():
return [l for l in ([ip for ip in socket.gethostbyname_ex(socket.gethostname())[2] if not ip.startswith("127.")][:1], [[(s.connect(('8.8.8.8', 53)), s.getsockname()[0], s.close()) for s in [socket.socket(socket.AF_INET, socket.SOCK_DGRAM)]][0][1]]) if l][0][0]

cdef class PyzmqWorker:
def __init__(self, host, jobs_port, results_port, models_port, maxLen, out_freq=100, tid=0, gpu=False, batch_size=8, seed=0, level=logging.INFO):
#Process.__init__(self)
Expand Down

0 comments on commit 9f10ae5

Please sign in to comment.