zmq_listener/zmq_connecter implemented

This commit is contained in:
Martin Sustrik
2009-08-09 16:12:09 +02:00
parent 3147ff8523
commit 9f1f823b7b
10 changed files with 239 additions and 33 deletions

View File

@@ -21,6 +21,7 @@
#define __ZMQ_TCP_CONNECTER_HPP_INCLUDED__
#include "fd.hpp"
#include "ip.hpp"
namespace zmq
{
@@ -34,11 +35,14 @@ namespace zmq
tcp_connecter_t ();
~tcp_connecter_t ();
// Set IP address/port to connect to.
int set_address (const char *addr_);
// Open TCP connecting socket. Address is in
// <hostname>:<port-number> format. Returns -1 in case of error,
// 0 if connect was successfull immediately and 1 if async connect
// was launched.
int open (const char *addr_);
int open ();
// Close the connecting socket.
int close ();
@@ -53,6 +57,9 @@ namespace zmq
private:
// Address to connect to.
sockaddr_in addr;
// Underlying socket.
fd_t s;