Net::HL7::Daemon - a simple HL7 server
SYNOPSIS
use Net::HL7::Daemon;
my $d = new Net::HL7::Daemon() || die;
while (my $c = $d->accept) {
$c->close;
undef($c);
}
DESCRIPTION
Instances of the Net:HL7::Daemon class listen on a socket for incoming requests. The accept() method will return when a connection from a client is available. The returned value will be a reference to a object of the Net::HL7::Daemon::Client class.
This daemon does not fork(2) for you. Your application, i.e. the user of the Net::HL7::Daemon is reponsible for forking if that is desirable.
METHODS
The Net::HL7::Daemon class provides the following methods:
new([%args])
= $d = new(%args)
The constructor takes any parameters that can also be passed to IO::Socket.
$d = new Net::HL7::Daemon( LocalPort => 12001, Listen => 5 )
$c = $d->accept()
This method is the same as IO::Socket::accept but returns an Net::HL7::Daemon::Client reference. It returns undef if you specify a timeout for the daemon and no connection is made within that time.
Net::HL7::Daemon::Client
SYNOPSIS
my $d = new Net::HL7::Daemon();
while (my $client = $d->accept()) {
my $msg = $client->getRequest();
$client->sendAck();
}
DESCRIPTION
The Net::HL7::Daemon::Client class provides a handler for incoming HL7 requests. The client holds the message that came in, if it was valid HL7, and can be used to send either an acknowledgement, or an error back to the caller.
METHODS
new()
getRequest()
Return a reference to a Net::HL7::Request object.
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 73:
=pod directives shouldn't be over one line long! Ignoring all 2 lines of content
- Around line 159:
=pod directives shouldn't be over one line long! Ignoring all 2 lines of content