[zeromq-dev] Load balancing & PGM

Tamara Kustarova kustarova at fastmq.com
Mon Mar 30 10:03:37 CEST 2009


Hello Steven,

the code I have sent, concerning windows pgm sockets is currently not 
merged in trunk, and it is very experimental now. I sent it just because 
Vladimir wanted to have a look at it, but please note that this code is 
not definite now and will undergo several changes, till it is commited 
into trunk.

Tamara

Steven McCoy napsal(a):
> 2009/3/30 Martin Sustrik <sustrik at fastmq.com>:
>   
>> This is on the roadmap already (ZMQ-204), still, won't listening socket
>> signal POLLIN only if a new packet arrives? If so, the accept should be
>> immediate.
>>     
>
> I'm referring to the code pgm_socket.cpp:724-741:
>
>         s = socket (AF_INET, SOCK_RDM, IPPROTO_RM);
>
> ...
>         rc = bind (s, (SOCKADDR *)&salocal, sizeof(salocal));
>
> ...
>
>         rc = listen (s, 10);
>
> ...
>         receiver_socket = accept (s, (SOCKADDR *)&sasession, &sasessionsz);
>
>
> This will block until the first packet arrives, ideally the socket s
> should be used as part of your poll set before accepting the
> connection and then adding receiver_socket.
>
> On the connection notification you should be able to determine the
> sender as per the accept manpage without the overhead of accepting
> every connection:
>
>     "One can obtain user connection request data without confirming the con-
>      nection by issuing a recvmsg(2) call with an msg_iovlen of 0 and a non-
>      zero msg_controllen, or by issuing a getsockopt(2) request."
>
>   




More information about the zeromq-dev mailing list