.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" 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 .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Net::Server::Coro 3pm" .TH Net::Server::Coro 3pm "2018-08-20" "perl v5.26.2" "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" Net::Server::Coro \- A co\-operative multithreaded server using Coro .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Coro; \& use base qw/Net::Server::Coro/; \& \& _\|_PACKAGE_\|_\->new\->run; \& \& sub process_request { \& ... \& cede; \& ... \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Net::Server::Coro implements multithreaded server for the Net::Server architecture, using Coro and Coro::Socket to make all reads and writes non-blocking. Additionally, it supports non-blocking \s-1SSL\s0 negotiation. .SH "METHODS" .IX Header "METHODS" Most methods are inherited from Net::Server \*(-- see it for further usage details. .SS "new" .IX Subsection "new" Create new Net::Server::Coro object. It accepts these parameters (in addition to Net::Server parameters): .IP "server_cert" 4 .IX Item "server_cert" Path to the \s-1SSL\s0 certificate that the server should use. This can be either relative or absolute path. Defaults to \&\fIcerts/server\-cert.pem\fR .IP "server_key" 4 .IX Item "server_key" Path to the \s-1SSL\s0 certificate key that the server should use. This can be either relative or absolute path. Defaults to \&\fIcerts/server\-key.pem\fR .SS "proto_object \s-1HOST, PORT, PROTO\s0" .IX Subsection "proto_object HOST, PORT, PROTO" Wraps socket creation, turning all socket types into Net::Server::Proto::Coro objects. .SS "loop" .IX Subsection "loop" The main loop uses starts a number of Coro coroutines: .IP "\(bu" 4 One for each listening socket. .IP "\(bu" 4 One for each active connection. Since these may respawn on a firlay frequent basis, \*(L"async_pool\*(R" in Coro is used to maintain a pool of coroutines. .IP "\(bu" 4 An AnyEvent infinite wait, which equates to the \*(L"run the event loop.\*(R" .SS "server_cert [\s-1PATH\s0]" .IX Subsection "server_cert [PATH]" Gets or sets the path of the \s-1SSL\s0 certificate used by the server. .SS "server_key [\s-1PATH\s0]" .IX Subsection "server_key [PATH]" Gets or sets the path of the \s-1SSL\s0 key file used by the server. .SH "DEPENDENCIES" .IX Header "DEPENDENCIES" Coro, AnyEvent, Net::Server .SH "BUGS AND LIMITATIONS" .IX Header "BUGS AND LIMITATIONS" The client filehandle, socket, and peer information all use Coro::Specific in order to constrain their information to their coroutine. Attempting to access them from a different coroutine will yield possibly unexpected results. .PP Generally, all those of Coro. Please report any bugs or feature requests specific to Net::Server::Coro to \&\f(CW\*(C`bug\-net\-server\-coro@rt.cpan.org\*(C'\fR, or through the web interface at . .SH "AUTHORS" .IX Header "AUTHORS" Alex Vandiver \f(CW\*(C`\*(C'\fR; code originally from Audrey Tang \f(CW\*(C`\*(C'\fR .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2006 by Audrey Tang .PP Copyright 2007\-2008 by Best Practical Solutions .PP This software is released under the \s-1MIT\s0 license cited below. .ie n .SS "The ""\s-1MIT""\s0 License" .el .SS "The ``\s-1MIT''\s0 License" .IX Subsection "The MIT License" Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \&\*(L"Software\*(R"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: .PP The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. .PP \&\s-1THE SOFTWARE IS PROVIDED \*(L"AS IS\*(R", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\s0