Home arrow PHP arrow Building A Document Request Protocol Part 1/2
PHP

Building A Document Request Protocol Part 1/2


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.

Author Info:
By: Mitchell Harper
Rating: 5 stars5 stars5 stars5 stars5 stars / 2
February 23, 2002
TABLE OF CONTENTS:
  1. · Building A Document Request Protocol Part 1/2
  2. · Our protocol: SARP
  3. · The VB application
  4. · The ProcessCommands routine
  5. · Accepting new records from the client
  6. · Our VB App in action
  7. · Conclusion

print this article
SEARCH DEVARTICLES

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. 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.
blog comments powered by Disqus
PHP ARTICLES

- Removing Singletons in PHP
- Singletons in PHP
- Implement Facebook Javascript SDK with PHP
- 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

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials