.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Message::Passing::ZeroMQ::Role::HasASocket 3pm" .TH Message::Passing::ZeroMQ::Role::HasASocket 3pm "2021-12-22" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Message::Passing::ZeroMQ::Role::HasASocket \- Role for instances which have a ZeroMQ socket. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" .SS "socket_bind" .IX Subsection "socket_bind" Bind a server to an address. .PP For example \f(CW\*(C`tcp://*:5222\*(C'\fR to make a server listening on a port on all of the host's addresses, or \f(CW\*(C`tcp://127.0.0.1:5222\*(C'\fR to bind the socket to a specific \s-1IP\s0 on the host. .SS "connect" .IX Subsection "connect" Connect to a server. For example \f(CW\*(C`tcp://127.0.0.1:5222\*(C'\fR. .PP This option is mutually exclusive with socket_bind, as sockets can connect in one direction only. .SS "socket_type" .IX Subsection "socket_type" The connection direction can be either the same as, or the opposite of the message flow direction. .PP The currently supported socket types are: .PP \fI\s-1PUB\s0\fR .IX Subsection "PUB" .PP This socket publishes messages to zero or more subscribers. .PP All subscribers get a copy of each message. .PP \fI\s-1SUB\s0\fR .IX Subsection "SUB" .PP The pair of \s-1PUB,\s0 receives broadcast messages. .PP \fI\s-1PUSH\s0\fR .IX Subsection "PUSH" .PP This socket type distributes messages in a round-robin fashion between subscribers. Therefore N subscribers will see 1/N of the message flow. .SS "\s-1PULL\s0" .IX Subsection "PULL" The pair of \s-1PUSH,\s0 receives a proportion of messages distributed. .SS "linger" .IX Subsection "linger" Integer indicating the value of the \s-1ZMQ_LINGER\s0 options. .PP Defaults to 0 meaning sockets will not block on shutdown if a server is unavailable (i.e. queued messages will be discarded). .PP \fIsocket_hwm\fR .IX Subsection "socket_hwm" .PP Set the High Water Mark for the socket. Depending on the socket type, messages are likely to be discarded once this high water mark is exceeded (i.e. there are more than this many messages buffered). .PP A value of 0 disables the high water mark, meaning that messages will be buffered until \s-1RAM\s0 runs out. .PP \fIsocket_builder\fR .IX Subsection "socket_builder" .PP A code reference returning a new ZeroMQ::Socket instance within a new ZeroMQ::Context every time it is called. .PP If a value this attribute is provided, responsibility for building sockets is solely the callback's responsibility. None of the other attributes usually involved in creating sockets, such as \f(CW\*(C`socket_type\*(C'\fR, \f(CW\*(C`linger\*(C'\fR, or \&\f(CW\*(C`socket_hmw\*(C'\fR will be taken into account automatically. .PP If a socket builder callback needs to make use of the aforementioned attributes, it will have to do so manually by looking at the object implementing \&\f(CW\*(C`Message::Passing::ZeroMQ::Role::HasASocket\*(C'\fR, which is going to be passed to the callback as the first argument upon invocation. .PP The second and final argument passed to the callback with be a newly ZeroMQ::Context that the new socket is expected to be created in. .SH "METHODS" .IX Header "METHODS" .SS "setsockopt" .IX Subsection "setsockopt" For wrapping by sub-classes to set options after the socket is created. .SH "SPONSORSHIP" .IX Header "SPONSORSHIP" This module exists due to the wonderful people at Suretec Systems Ltd. who sponsored its development for its VoIP division called SureVoIP for use with the SureVoIP \s-1API\s0 \- .SH "AUTHOR, COPYRIGHT AND LICENSE" .IX Header "AUTHOR, COPYRIGHT AND LICENSE" See Message::Passing::ZeroMQ.