IKC::Server(3)
π IKC::Server(3) β POE::Component::IKC::Server π
okay bestie, so this is the manual page for IKC::Server(3), which lives in the User Contributed Perl Documentation section, and honestly? it's a whole vibe. it's the POE Inter-kernel Communication server. let's get into it π«Ά
β¨ NAME β¨
POE::Component::IKC::Server β the POE Inter-kernel Communication server, aka the girl who answers the door when other kernels come knocking π
π SYNOPSIS π
use POE;
use POE::Component::IKC::Server;
POE::Component::IKC::Server->spawn(
ip=>$ip,
port=>$port,
name=>'Server');
...
$poe_kernel->run();
that's it. that's the whole summoning ritual β¨
π¦ DESCRIPTION π¦
so this module implements a POE IKC server, no cap. an IKC server just sits there listening for incoming connections from IKC clients β like, it's literally the social one at the party π
when a client connects, it negociates certain connection parameters (yes, it's giving handshake diplomacy). and after that? bestie, the POE server and the client are pretty much identical. twins. matching outfits. iconic π
πΈ EXPORTED FUNCTIONS πΈ
create_ikc_server
Deprecated. π¨ like, do not use this. use spawn in POE::Component::IKC::Server instead. moving on π
β CLASS METHODS β
spawn
this method initiates all the work of building the IKC server. it's the main character of this whole page, honestly. the parameters are:
ipβ the address to listen on. can be a doted-quad ('127.0.0.1') or a host name ('foo.pied.nu'). defaults to'0.0.0.0', aka INADDR_ANY. she's flexible πββοΈportβ the port to listen on. can be numeric (80) or a service ('http'). if it's undefined, it defaults to603. and here's the fun part: if you set the port to0, a random port gets chosen andspawnwill return the port number π°
my $port = POE::Component::IKC::Server->spawn( port => 0 );
warn "Listeing on port $port";
(yes, "Listeing" β that's verbatim, i don't make the rules, i just report them π)
unixβ path to the unix-socket to listen on. β οΈ note: this path is unlinked before the socket is attempted! buyer beware, fr fr. it's giving "no take-backsies" πnameβ the local kernel name. this is how we shall "advertise" ourself to foreign kernels β it acts as a "kernel alias". this parameter is temporary, pending the addition of true kernel names in the POE core. this name, and all aliases, will be registered with the responder so you can post to them as if they were remote. lowkey genius β¨aliasesβ arrayref of even more aliases for this kernel. Fun Fun Fun! πverboseβ if true, print extra information toSTDERR. this lets you see what's going on and potentially trace down problems and stuff. your debug bestie πprocessesβ activates the pre-forking server code. if set to a positive value, IKC will forkprocesses-1children. IKC requests are only serviced by the children. the default is1(ie, no forking) π§babysitβ the time, in seconds, between invocations of the babysitter event. she's literally babysitting πΆconnectionsβ the number of connections a child will accept before exiting. currently, connections are serviced concurrently, because there's no way to know when we have finished a request. defaults to1(ie, one connection per child).concurrencyβ the number of simultaneous connected clients allowed. defaults to0(unlimited) π
heads up: this is per-IKC::Server instance. if you have several ways of connecting to a give IKC server (for example, both an TCP/IP port and unix pipe), they will not share the conncurrent connection count. so like, they don't pool. okay? okay π
protocolβ which IKC negociation protocol to use. the original protocol ("IKC") had a slow synchronous handshake. the new protocol ("IKC0") sends all the handshake information at once.IKC0will degrade gracefully toIKCif the client and server don't match β she's adaptable like that π
default is IKC0.
on_errorβ a coderef that's called for all errors. you could use this to monitor for problems when forking children or opening the socket. the parameters are$operation,$errnumand$errstr, which correspond to POE::Wheel::SocketFactory'sFailureEvent, which q.v. π¨
however β IKC/monitor provides a more powerful mechanism for detecting errors. see POE::Component::IKC::Responder.
also note that the coderef will be executed from within an IKC session, NOT within your own session. this means things like $poe_kernel->delay_set() won't do what you think they should. surprise! π
POE::Component::IKC::Server::spawn returns undef(), unless you specify a port=0, in which case spawn returns the port that was chosen. slay π
π₯ EVENTS π₯
shutdown
this event causes the server to close it's socket, clean up the shop and head home π normally it's only posted from IKC::Responder. like, it's an internal thing, iykyk.
π BUGS π
preforking is something of a hack. in particular, you must make sure that your sessions will permit children exiting β which means if you have a delay()-loop, or event loop, children will not exit π once POE gets multicast events, this behaviour will change. so like, it's a known thing, don't come for her π
π AUTHOR π
Philip Gwyn, <perl-ikc at pied.nu> π«Ά
π COPYRIGHT AND LICENSE π
Copyright 1999-2014 by Philip Gwyn. All rights reserved.
this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
see <http://www.perl.com/language/misc/Artistic.html> β
π SEE ALSO π
- POE
- POE::Component::IKC::Client
okay that's the whole page, bestie, you're officially an IKC server expert now, no cap π
perl v5.42.0 Β· 2025-12-14 Β· IKC::Server(3) β mwah, go forth and spawn servers β¨ππ¦
π¦ where this page comes from
- arch rolling: perl-poe-component-ikc 0.2402-13 Β· GPL AND PerlArtistic
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms