Created
November 29, 2016 15:20
-
-
Save moio/13030dbf575f998cdd6bcc430da6c4fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
import subprocess | |
import sys | |
import zmq | |
SERVER_ADDRESS = "tcp://suma3pg.tf.local:4505" | |
print "libzmq-%s" % zmq.zmq_version() | |
print "pyzmq-%s" % zmq.pyzmq_version() | |
print "Python-%s" % sys.version | |
context = zmq.Context() | |
socket = context.socket(zmq.XSUB) | |
print("TCP_KEEPALIVE value: %s" % socket.getsockopt(zmq.TCP_KEEPALIVE)) | |
socket.connect(SERVER_ADDRESS) | |
subprocess.call("netstat -eepto | grep 4505 | grep ESTABLISHED", shell=True) | |
socket = context.socket(zmq.XSUB) | |
socket.setsockopt(zmq.TCP_KEEPALIVE, 300) | |
print("TCP_KEEPALIVE value: %s" % socket.getsockopt(zmq.TCP_KEEPALIVE)) | |
socket.connect("tcp://suma3pg.tf.local:4505") | |
subprocess.call("netstat -eepto | grep 4505 | grep ESTABLISHED", shell=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment