PHP
  Home arrow PHP arrow Developing an Extensible TCP Server wi...
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 
Moblin 
JMSL Numerical Library 
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? 
PHP

Developing an Extensible TCP Server with Sockets in PHP
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 9
    2006-05-30

    Table of Contents:
  • Developing an Extensible TCP Server with Sockets in PHP
  • A quick look at the previous TCP server
  • Expanding the original TCP server: processing multiple client requests
  • Defining the createSocketServer() function and the SocketServer class

  • 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


    Developing an Extensible TCP Server with Sockets in PHP


    (Page 1 of 4 )

    Are you interested in learning how to manipulate low-level sockets in PHP? Your search has finished. This is the second part of the series “Handling sockets in PHP,” and hopefully you’ll find in it valuable material regarding the creation and manipulation of sockets with PHP, in conjunction with numerous illustrative hands-on examples that will help you build socket servers in a few easy steps.

    Introduction

    For those who haven't read my first tutorial yet, let me briefly recapitulate the topics that I treated previously. To begin with, I explained how to create a low-level socket in PHP and perform some key operations with it, such as pushing in and pulling out data streams.

    Aside from covering some key points related to handling sockets, I set up a complete example, which focused on developing a simple TCP server and the corresponding client. In this way I demonstrated how they can communicate with each other, introducing some kind of basic processing on the traveling data.

    After testing the sample TCP server that I developed in the first article, surely you'll realize the excellent capabilities that come with PHP for handling sockets, and more generally for addressing common issues associated with network programming. Going deeper into socket manipulation, building end-to-end communication channels as part of an application allows you to understand much better the logic behind the relationship between server and clients. Considering this crucial concept, programming sockets in PHP can be a useful experience.

    Now, focusing specifically on this second article of the series, I'll go one step further in the manipulation of low-level sockets, and show you how to expand the TCP server that was constructed previously, in order to provide it with the ability to attend to multiple requests coming from the same client. Hopefully, this experience will help you to get a more intimate knowledge of socket handling in PHP.

    With the preliminaries out of the way, let's get started.

    More PHP Articles
    More By Alejandro Gervasio


       · Over this second installment, you'll learn how to build a TCP server, which is...
     

       

    PHP ARTICLES

    - Validating Web Forms with the Code Igniter P...
    - Output Buffering
    - Paginating Database Records with the Code Ig...
    - HTTP Headers in Web Development
    - Project Management: Administration
    - Building a Database-Driven Application with ...
    - User Authentication for a Project Management...
    - Introduction to the CodeIgniter PHP Framework
    - Adding Users for a Project Management Applic...
    - Migrating Class Code for a MIME Email to PHP...
    - Login and Logout Authentication for a Projec...
    - Composing Messages in HTML for MIME Email wi...
    - Project Management: Authentication
    - A Better Way to Determine MIME Types for MIM...
    - Project Management Overview





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