Net::SIGTRAN::SCTP

Have released a draft beta version of SCTP Perl Module that is published in CPAN.

This SCTP module is created to access lksctp to provide SCTP implementation. Before installing Net::SIGTRAN::SCTP, make sure that the following package:

$ rpm -qa|grep sctp
lksctp-tools-1.0.6-3.el5
lksctp-tools-devel-1.0.6-3.el5

Alternatively you can download and compile the source from http://lksctp.sourceforge.net.

The following is example source code to get started.

SCTP Server Example


use Net::SIGTRAN::SCTP; 
use threads;

my $server=new Net::SIGTRAN::SCTP( PORT=>12345 );
my $ssock=$server->bind(); 
if ($ssock) { 
   my $csock; 
   while($csock = $server->accept($ssock)) { 
      print "New Client Connection\n"; 
      my $thr=threads->create(\&processRequest,$server,$csock); 
      $thr->detach();
   }
}

sub processRequest { 
   my $connection=shift; 
   my $socket=shift; 
   my ($readlen,$buffer)= $connection->recieve($socket,1000); 
   print "Recieved ($readlen,$buffer)\n"; 
}

SCTP Server Example


use Net::SIGTRAN::SCTP;

my $textstring='Hello World';
my $client=new Net::SIGTRAN::SCTP( HOST=>'127.0.0.1', PORT=>12345 );

my $csock=$client->connect();

$client->send($csock,0,length($textstring),$textstring); 
$client->close($csock);

INSTALLATION

To install the module, perform the usual perl module installation procedures. The following is the steps:


perl Makefile.PL
make
make install

Comments are closed.