PHP
  Home arrow PHP arrow Building A Document Request Protocol Part ...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
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

Building A Document Request Protocol Part 1/2
By: Mitchell Harper
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2002-02-23

    Table of Contents:
  • Building A Document Request Protocol Part 1/2
  • Our protocol: SARP
  • The VB application
  • The ProcessCommands routine
  • Accepting new records from the client
  • Our VB App in action
  • 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


    Building A Document Request Protocol Part 1/2


    (Page 1 of 7 )

    Disparate systems communicate with each other using protocols. A protocol is a set of rules that governs the transmission of data between two independent systems. If you're familiar with protocols, then you will know that most are composed of simple, plain text commands. In this article Mitchell shows us how to create a protocol and implement it as a server using Visual Basic and Winsock.Disparate systems communicate with each other using protocols. A protocol is a set of rules that governs the transmission of data between two independent systems. The Internet is the most common way to share data across two systems.

    The Internet's transport protocol is TCP/IP, which actually moves the data (in the form of packets) from computer to computer, however there are also many other protocols that we use every day without even thinking about it: SMTP for mail, NNTP for UseNet news groups, UDP for file sharing programs such as Morpheus and Napster, etc.

    If you're familiar with any of these protocols, then you will know that most are composed of simple, plain text commands, such as "GROUP alt.news.php" to tell a UseNet server that you'd like to connect to the alt.news.php news group.

    Most protocols are standards, and are defined by the IETF (Internet Engineering Task Force) in individual RFC (request for comment) documents. If you've never worked with protocols before, then you might want to read over the RFC's for some of the more common protocols before continuing, just to get an idea of how they are composed:Typically a client connects to a server through a socket. That particular socket on the server "listens" for client requests, and uses one pre-defined protocol. The client sends messages( confirming to the standards of that protocol) to the server, and the server responds with the required data, such as the body of an email message, the number of messages in a news group, etc. This continues until either the client or server closes the connection.

    In this, the first article of a two part series, we're going to look at creating our own protocol. We will create a Visual Basic application that listens on a specified port for client connection requests. The client will be implemented in part two of this article, and it will be written entirely in PHP.

    To test the source code and samples included with this article, you should be running a Windows PC with Visual Basic 6, MDAC 2.6 or later, PHP, and also Microsoft Access 2000. Don't worry if you don't have Access however, because the database we will be using is included with the support material at the end of this article.

    You should also have an intermediate understanding of the Visual Basic programming language, Winsock, ADO, PHP, and PHP's various socket functions, including fsockopen, fputs, and fgets.

    More PHP Articles
    More By Mitchell Harper


     

    PHP ARTICLES

    - Making Usage Statistics in PHP
    - Installing PHP under Windows: Further Config...
    - File Version Management in PHP
    - Statistical View of Data in a Clustered Bar ...
    - Creating a Multi-File Upload Script in PHP
    - Executing Microsoft SQL Server Stored Proced...
    - Code 10x More Efficiently Using Data Access ...
    - A Few Tips for Speeding Up PHP Code
    - The Modular Web Page
    - Quick E-Commerce with PHP and PayPal
    - Regression Testing With JMeter
    - Building an Iterator with PHP
    - PHP Frontend to ImageMagick
    - Using PEAR's mimeDecode Module
    - Incoming Mail and PHP







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek