Lubomir Rintel
and 1 contributors

NAME

Net::SPDY::Session - Handle SPDY protocol connection

ALPHA WARNING

Please read carefully: This is an ALPHA stage software. In particular this means that even though it probably won't kill your cat, re-elect George W. Bush nor install Solaris 11 Express edition to your hard drive, it is in active development, functionality is missing and no APIs are stable.

See TODO file in the distribution to learn about missing and planned functionality. You are more than welcome to join the development and submit patches with fixes or enhancements. Bug reports are probably not very useful at this point.

SYNOPSIS

  use Net::SPDY::Session;

  my $server = new IO::Socket::SSL (
      LocalAddr => 'localhost:443',
      ReuseAddr => 1,
      SSL_server => 1,
      SSL_cert_file => $cert,
      SSL_key_file => $key,
      SSL_npn_protocols => ['spdy/3'])
      or die IO::Socket::SSL::errstr;

  while (my $client = $server->accept) {
      # Fork a child to handle the connection
      my $kidpid = fork;
      die $! unless defined $kidpid;
      # Proceed with next connection
      next if $kidpid;

      my $session = new Net::SPDY::Session ($client);
      while ($session->process_frame) {
           ...
      }
  }

DESCRIPTION

Net::SPDY::Session represents the single stateful SPDY connection along with its state, which in called a session.

It provides access to the underlying protocol and convenience functions to access the state and communicate via the protocol.

PROPERTIES

compressor

Net::SPDY::Compressor object representing the Zlib streams (one in each direction) used by the framer. A new one is created upon session construction.

socket

IO::Handle instance that is used for actual network communication.

framer

Net::SPDY::Framer the protocol implementation on top of socket and compressor it is coupled with. A new one is created upon session construction.

METHODS

new SOCKET

Creates a new session instance. First argument is the socket (either server or client, it does not matter) for the network communication.

process_frame

Read a single frame from the framer and process it, which may include changing session state and and eventually sending an appropriate response.

close

Do whatever is needed to terminate a connection. May involve sending a GOAWAY frame and closing the socket.

SEE ALSO

CONTRIBUTING

Source code for Net::SPDY is kept in a public GIT repository. Visit https://github.com/lkundrak/net-spdy.

Bugs reports and feature enhancement requests are tracked at https://rt.cpan.org/Public/Dist/Display.html?Name=Net::SPDY.

COPYRIGHT

Copyright 2012, Lubomir Rintel

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Lubomir Rintel lkundrak@v3.sk