31 #if defined (ZMQ_HAVE_WINDOWS)    32 #   include <winsock2.h>    33 #   include <ws2tcpip.h>    35 #   define close closesocket    37 #   include <sys/socket.h>    38 #   include <netinet/in.h>    39 #   include <arpa/inet.h>    48         char *version = 
s_recv (handler);
    52         char *sequence = 
s_recv (handler);
    53         char *domain = 
s_recv (handler);
    55         char *identity = 
s_recv (handler);
    56         char *mechanism = 
s_recv (handler);
    58         assert (
streq (version, 
"1.0"));
    59         assert (
streq (mechanism, 
"NULL"));
    63         if (
streq (domain, 
"TEST")) {
    96     int rc = 
zmq_bind (handler, 
"inproc://zeromq.zap.01");
   108     rc = 
zmq_bind (server, 
"tcp://127.0.0.1:9000");
   125     rc = 
zmq_bind (server, 
"tcp://127.0.0.1:9001");
   140     rc = 
zmq_bind (server, 
"tcp://127.0.0.1:9002");
   153     rc = 
zmq_bind (server, 
"tcp://127.0.0.1:9003");
   156     struct sockaddr_in ip4addr;
   159     ip4addr.sin_family = AF_INET;
   160     ip4addr.sin_port = htons(9003);
   161 #if defined (ZMQ_HAVE_WINDOWS) && (_WIN32_WINNT < 0x0600)   162     ip4addr.sin_addr.s_addr = inet_addr (
"127.0.0.1");
   164     inet_pton(AF_INET, 
"127.0.0.1", &ip4addr.sin_addr);
   167     s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
   168     rc = connect (s, (
struct sockaddr*) &ip4addr, 
sizeof ip4addr);
   171     send (s, 
"\x01\x00", 2, 0);
   173     send (s, 
"\x08\x00sneaky\0", 9, 0);
   176     char *buf = 
s_recv (server);
   178         printf (
"Received unauthenticated message: %s\n", buf);
   179         assert (buf == NULL);
 ZMQ_EXPORT int zmq_setsockopt(void *s, int option, const void *optval, size_t optvallen)
 
int s_sendmore(void *socket, const char *string)
 
ZMQ_EXPORT void * zmq_ctx_new(void)
 
static void zap_handler(void *handler)
 
void setup_test_environment(void)
 
void expect_bounce_fail(void *server, void *client)
 
void handler(int timer_id, void *arg)
 
ZMQ_EXPORT void * zmq_socket(void *, int type)
 
ZMQ_EXPORT void zmq_threadclose(void *thread)
 
ZMQ_EXPORT int zmq_connect(void *s, const char *addr)
 
char * s_recv(void *socket)
 
void close_zero_linger(void *socket)
 
void bounce(void *server, void *client)
 
ZMQ_EXPORT int zmq_bind(void *s, const char *addr)
 
ZMQ_EXPORT int zmq_ctx_term(void *context)
 
int s_send(void *socket, const char *string)
 
ZMQ_EXPORT void * zmq_threadstart(zmq_thread_fn *func, void *arg)