… | |
… | |
134 | |
134 | |
135 | The timeout should be large enough to cover at least four network |
135 | The timeout should be large enough to cover at least four network |
136 | round-trips and one message round-trip. |
136 | round-trips and one message round-trip. |
137 | |
137 | |
138 | Example: on node1, establish a connection to node2 and send a line of text, |
138 | Example: on node1, establish a connection to node2 and send a line of text, |
139 | one node2, provide a receiver function. |
139 | on node2, provide a receiver function. |
140 | |
140 | |
141 | # node1, code executes in some port context |
141 | # node1, code executes in some port context |
142 | AnyEvent::MP::DataConn::connect_to "node2", 5, "pkg::receiver", 1, sub { |
142 | AnyEvent::MP::DataConn::connect_to "node2", 5, "pkg::receiver", 1, sub { |
143 | my ($hdl) = @_; |
143 | my ($hdl) = @_; |
144 | warn "connection established, sending line.\n" |
144 | warn "connection established, sending line.\n" |