Skip to content

Instantly share code, notes, and snippets.

@yishenggudou
Created November 16, 2012 08:34
Show Gist options
  • Save yishenggudou/4085500 to your computer and use it in GitHub Desktop.
Save yishenggudou/4085500 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011 timger
# +Author timger
# +Gtalk&Email yishenggudou@gmail.com
# +Msn yishenggudou@msn.cn
# +Weibo @timger http://t.sina.com/zhanghaibo
# +twitter @yishenggudou http://twitter.com/yishenggudou
# Licensed under the MIT License, Version 2.0 (the "License");
import zmq
from time import sleep
import sys
def test_pub():
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.connect('tcp://127.0.0.1:50001')
#socket.bind('tcp://0.0.0.0:5555')
for line in sys.stdin:
socket.send(line)
test_pub()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment