Maxscape::HTTP::Connection Package

Synopsis

Maxdaemon::Daemon::Connection handles client/server network connections.
use Maxscape::HTTP::Connection;

Description

Maxdaemon::Daemon::Connection handles client/server network connections. It implements the functionality for TCP/IP connections between clients and an HTTP(S) daemon using sockets.

List of Member Functions

  1. byte_count
  2. check_keep_alive
  3. ClientIP
  4. closeSocket
  5. closeSSLConnection
  6. getRequest
  7. lookupClientIP
  8. new
  9. newSSLConnection
  10. Read
  11. readByteCounter
  12. readLine
  13. reset_byte_count
  14. setSSLEncoding
  15. write
  16. write_keep_alive
  17. writeAlsoToSTDERR

Member Functions

new

Synopsis

my $Connection = Maxscape::HTTP::Connection->new ();

Description

Creates a Maxscape::HTTP::Connection object.

Examples

$self->{ClientConnection} = Maxscape::HTTP::Connection->new (
      DocumentRoot        => $self->{Configure}->{DocumentRoot},
      Encryption          => $self->{Encryption},
      ClientSocket        => $self->{ClientSocket},
      acptaddr            => $self->{Client_acptaddr},
      rmask               => $self->{ServerSocketFileMask},
      ClientSocketTimeout => $self->{Configure}->{ClientSocketTimeout},
      SSLContext          => $self->{SSLContext},
      SSLCertificateFile  => $self->{Configure}->{SSLCertificateFile},
      RSAPrivateKey_file  => $self->{Configure}->{RSAPrivateKey_file},
);

newSSLConnection

Synopsis

my $ClientConnection = $HTTPD->{ClientConnection}->newSSLConnection();

Description

Establishes an SSL connection to a client.

closeSocket

Synopsis

$Connection->closeSocket();

Description

Closes the client socket.

closeSSLConnection

Synopsis

$ClientConnection->closeSSLConnection();

Description

Closes the SSL part of a connection.

getRequest

Synopsis

my ($RC, $Request) = $Client->getRequest ($self->{RewriteURI_Callback});

Description

Gets a request from a client.

readLine

Synopsis

$RequestLine = $self->readLine ();

Description

Reads a line from the client connection.

Read

Synopsis

my $CGI_Buffer = $Client->Read ($Length);

Description

Reads $Length bytes fron a client's connection.

readByteCounter

Synopsis

my $ByteCounter = $Client->readByteCounter();

Description

Returns the current connections byte counter.

writeAlsoToSTDERR

Synopsis

$Client->writeAlsoToSTDERR ($ONOFF);

Description

Turns writing connection data to STDERR on.

setSSLEncoding

Synopsis

$Client->setSSLEncoding (''utf-8-strict);

Description

Initial set up of an SSL connection.

write

Synopsis

$Client->write ("HTTP/1.0 $RC $RC_Message\r\n");

Description

Writes a string to a socket, possibly SSL encrypted.

Examples

$Client->write ("HTTP/1.0 $RC $RC_Message$CRLF",
                . "Server: $self->{ServerSoftware}$CRLF",
                ...
);

reset_byte_count

Synopsis

$Client->reset_byte_count();

Description

Resets the write data counter.

byte_count

Synopsis

my $writeDataCounter = $Client->byte_count;

Description

Returns the write data counter.

Examples


 
 

write_keep_alive

Synopsis

$Client->write_keep_alive();

Description

Writes a keep alive header to the connection.

check_keep_alive

Synopsis

$Client->check_keep_alive();

Description

Checks if a requests header's connection is 'keep-alive'.

lookupClientIP

Synopsis

my ($ClientIP, $ClientPort, $ClientHostName) = $Client->lookupClientIP ($Conf);

Description

Looks up the client's IP.

Examples

my ($ClientIP, $ClientPort, $ClientHostName) =
                         $Client->lookupClientIP ($Configure{HostnameLookups});

ClientIP

Synopsis

my $ClientIP = $Client->ClientIP()

Description

Returns the IP of a client.

1
Next ∙ Previous ∙ Top ∙ Join ∙ Contact © Maxscape