Net::HL7::Daemon
my $d = new Net::HL7::Daemon( LocalPort => 12002, Listen => 5 );
The Net::HL7::Daemon class provides a Daemon, roughly based on the well known HTTP::Daemon class. The daemon wraps IO::Socket::INET so that incoming connections are returned as Net::HL7::Daemon::Client objects. Other than that the Daemon class doesn't do all that much. However, this allows you to use the Daemon class as a base for more elaborate servers, like preforking or multi-threaded servers. See the Perl Cookbook for examples on this, and think Net::HL7::Daemon where you see IO::Socket.
Net::HL7::Daemon::Client
The Net::HL7::Daemon::Client is also a IO::Socket::INET
subclass. Instances of this class are returned by the accept()
method
of Net::HL7::Daemon.
getNextRequest()
method, or if
that hasn't been called yet, the request read from the socket. The
latter is implemented by calling getNextRequest. If both fail,
undef
is returned.
In case of failure, then the Net::HL7::Daemon::Client
object ($c) should be discarded, and you should not call this method
again.
Potentially, a HL7 client can receive more than one message. So discard the client only when there's no more requests pending, or the delivering service might experience timeouts.
undef
if reading of the
request fails. If it fails, then the Net::HL7::Daemon::Client
object ($c) should be discarded, and you should not call this method
again. Potentially, a HL7 client can receive more than one
message. So discard the client only when there's no more requests
pending, or the delivering service might experience timeouts.
RFC 2068
Copyright 2003, D.A.Dokter
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.