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 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
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 / 10
    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

    - Authentication Scripts for a User Management...
    - Utilizing the Use Keyword for Namespaces in ...
    - Building a User Management Application
    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT