Perl
  Home arrow Perl arrow Page 2 - Programming Sockets with PERL
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PERL

Programming Sockets with PERL
By: Rahul Chauhan
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 52
    2004-04-21

    Table of Contents:
  • Programming Sockets with PERL
  • Types of Sockets
  • Client–Server Script in PERL
  • PERL Makes Life Easy
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Programming Sockets with PERL - Types of Sockets


    (Page 2 of 5 )

    There are just two types of sockets: connection oriented and connection-less. There are other types but this classification is fair enough to get started, a socket has a domain (UNIX or internet), a connection type (connection oriented or connection less) and a protocol (TCP or UDP).

    A connection oriented or a stream socket is a reliable two way communication. If you send three packets, say 1, 2 and 3, they are received in the same order they were sent. They achieve this high level of transmission quality by using TCP for error free reliable communication. The ubiquitous telnet application uses stream sockets.

    The connection-less sockets or stream-less sockets use IP for routing but use the UDP. They are connectionless, since the connection need not be open as in stream sockets, the packet formed is given a destination IP address and than transmitted. This method is mostly used for packet-to-packet transfer as in ftp applications.

    How a Packet is Formed

    We will use an example of UDP packet for some light stuff on networking theory. It's Data Encapsulation. A packet is formed by encapsulating the data in a header at each level as it passes through the layers (protocol stack). At the receiving end the headers are stripped off as the packet travels up the layers to get the data.

    Basically, at each layer, the protocol adds a header to the payload to perform the required functionality.

    Client Server Architecture

    It's a client-server world, today. Just about everything on the network deals with client processes talking to server processes and vice versa. Take the ubiquitous telnet, for instance. When you connect to a remote host on port 23 with telnet (the client), a program on that host (called telnetd, the server) springs to life. It handles the incoming telnet connection, sets up a login prompt, etc. Note that the client-server pair can speak in streaming or stream-less, or anything else (as long as they are speaking the same thing).

    Some good examples of client-server pairs are telnet/telnetd, ftp/ftpd.

    More Perl Articles
    More By Rahul Chauhan


     

       

    PERL ARTICLES

    - Perl: More on Lists and Hashes
    - Perl: Dimensional Lists
    - Perl: A Continuing Look at Hashes and Multid...
    - Perl: Another Round with Hashes
    - Perl Hashes
    - Perl Lists: A Final Look at List::Util
    - Perl Lists: Utilizing List::Util
    - Perl Lists: The Split() Function
    - SQL and CGI with Perl and DBI
    - Perl Lists: More Functions and Operators
    - SELECT Queries and Perl
    - Perl Lists: More on Manipulation
    - Creating a Database with Perl and DBI
    - Perl: Sailing the List(less) Seas
    - Perl and DBI

    Click Here




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway