IO::Socket::TIPC

TIPC sockets for Perl
Download

IO::Socket::TIPC Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Mark Glines
  • Publisher web site:
  • http://search.cpan.org/~infinoid/

IO::Socket::TIPC Tags


IO::Socket::TIPC Description

TIPC sockets for Perl TIPC stands for Transparent Inter-Process Communication. See http://tipc.sf.net/ for details.IO::Socket::TIPC is a Perl module subclasses IO::Socket, in order to use TIPC sockets in the customary (and convenient) Perl fashion.TIPC supports 4 types of socket: SOCK_STREAM, SOCK_SEQPACKET, SOCK_RDM and SOCK_DGRAM. These are all available through this perl API, though the usage varies depending on which kind of socket you use.SOCK_STREAM and SOCK_SEQPACKET are connection-based sockets. These sockets are strictly client/server. For servers, new() will call bind() for you, to bind to a Local* name, and you then accept() connections from clients, each of which get their own socket (returned from accept). For clients, new() will call connect() for you, to connect to the specified Peer* name, and once that succeeds, you can do I/O on the socket directly. In this respect, usage details are very similar to TCP over IPv4.See the EXAMPLES section, for an example of connection-based socket use.SOCK_RDM and SOCK_DGRAM are connectionless sockets. You cannot use the normal send/recv/print/getline methods on them, because the network stack will not know which host on the network to send or receive from. Instead, once you have called new() to create the socket, you use sendto and recvfrom to send and receive individual packets to/from a specified peer, indicated using an IO::Socket::TIPC::Sockaddr class object.Connectionless sockets (SOCK_RDM and SOCK_DGRAM) are often bind()ed to a particular Name or Nameseq address, in order to allow them to listen for packets sent to a well-known destination (the Name). You can use LocalName or LocalNameseq parameters to new(), to select a name or name-sequence to bind to. As above, these parameters internally become Name and Nameseq arguments to IO::Socket::TIPC::Sockaddr->new(), and the result is passed to bind(). This is very similar to typical uses of UDP over IPv4.Since connectionless sockets are not linked to a particular peer, you can use sendto to send a packet to some peer with a given Name in the network, and recvfrom to receive replies from a peer in the network who sends a packet to your Name (or Nameseq). You can also use Nameseq addressses to send multicast packets to *every* peer with a given name. Please see the Programmers_Guide.txt document (linked in REFERENCES) for more details.SYNOPSIS use IO::Socket::TIPC; my $sock = IO::Socket::TIPC->new( SocketType => "stream", Peer => "{1000, 100}" ); die "Could not connect to {1000, 100}: $! " unless $sock; Requirements: · Perl


IO::Socket::TIPC Related Software