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

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
  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

Building A Document Request Protocol Part 1/2 - Our protocol: SARP
(Page 2 of 7 )

We are going to create a protocol that will be used to request and modify a set of categories and articles. The protocol will be called Simple Article Request Protocol, or SARP for short.

The protocol will, in some ways be similar to the NNTP protocol. Here’s a list of the functions that our protocol will implement:
  • Logging in
  • Retrieving a category name
  • Retrieving a list of articles based on a category ID
  • Adding a new category
  • Adding a new article under a specific category
The protocol will expect simple text requests for its commands, and will operate on port 2002 by default. The categories and articles will be stored in an Access 2000 database, and the actual implementation of the protocol will be carried out using Visual Basic and the Winsock control.

Because the source code and accompanying program files for this article are rather large, we will only look at the most important parts of our implementation. You can download all of the code from the support material link, which is on the conclusions page.

Let's start by looking at the Access database that will hold our two tables: categories and articles:

The categories table

The articles table

The id field of the categories table links it to the articles table by the catId field. The fields in the tables should be self-explanatory. We will fill our database with the brands and models of luxury cars, as shown below:

Our access database

Our Access database will be responsible for providing our Visual Basic application with the data so that it can fulfill its SARP protocol requests to the client. Let's look at the Visual Basic application now.
blog comments powered by Disqus

- 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 

Developer Shed Affiliates


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