HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings.  2.0.0-chaika
Hierarchical Cluster Engine Python language binding
ServerConnectionBuilder.py
Go to the documentation of this file.
1 '''
2 Created on Feb 25, 2014
3 
4 @author: igor
5 '''
6 
7 
8 import zmq
9 from Connection import Connection
10 
11 
12 
15  '''
16  classdocs
17  '''
18 
19 
22  def __init__(self):
23  self.zmq_context = zmq.Context() # pylint: disable-msg=E1101
24  self.zmq_poller = zmq.Poller() # pylint: disable-msg=E1101
25 
26 
27 
33  def build(self, connect_params, socket_type=zmq.REP): # pylint: disable-msg=E1101,E0602
34  sock = self.zmq_context.socket(socket_type)
35  sock.bind(connect_params.host + ":" + str(connect_params.port))
36  return Connection(sock, self.zmq_poller)
def build(self, connect_params, socket_type=zmq.REP)
build a server side connection may raise zmq.ZMQBindError
It's a wrapper for building server side endpoint.