Home arrow PHP arrow Page 9 - Socket Programming With PHP

Game Over - PHP

You might not know this, but PHP comes with a very capable socketprogramming API. These socket functions now include almost everything youwould need for socket-based client-server communication over TCP/IP, andcan be easily deployed to build simple network applications. Find out more,inside.

TABLE OF CONTENTS:
  1. Socket Programming With PHP
  2. Putting It All Together
  3. Fortune's Fool
  4. Looping The Loop
  5. On Web-bed Feet
  6. Different Strokes
  7. POP Goes The Weasel
  8. Access Denied
  9. Game Over
By: icarus, (c) Melonfire
Rating: starstarstarstarstar / 204
February 05, 2002

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
And that's about all I have time for. In this article, you learned a little bit about PHP's socket programming functions, using them to create and manipulate socket connections in a networked environment. In addition to some simple examples, you also learned how to apply PHP's socket API to real-life situations with practical examples, including a POP3 client and an authentication server.

The latest version of PHP, PHP 4.1.0, comes with an updated socket API, one which offers developers greater control over socket creation and closely mimics the socket API used by programming languages like C and C++. As of this writing, many of these new functions have not yet been documented in the PHP manual; however, if you're familiar with socket programming in C, you should have no trouble adapting your code to use these new functions.

You can read up on PHP's socket functions at http://www.php.net/manual/en/ref.sockets.php

If you'd like to learn more about sockets and socket programming in general, here's a list of sites you might want to consider visiting:

http://www.ecst.csuchico.edu/~beej/guide/net

http://www.lcg.org/sock-faq

http://www.onlamp.com/pub/a/php/2001/03/29/socket_intro.html

http://phpbuilder.net/columns/armel20010427.php3?print_mode=1

http://w3.softlookup.com/tcp_ip

I hope you found this article interesting, and that it helped open your eyes to one of PHP's lesser-known capabilities. Let me know if you liked it...and, until next time, stay healthy!

Note: All examples in this article have been tested on Linux/i386 with Apache 1.3.12 and PHP 4.1.0. Examples are illustrative only, and are not meant for a production environment. Melonfire provides no warranties or support for the source code described in this article. YMMV!

 
 
>>> More PHP Articles          >>> More By icarus, (c) Melonfire
 

blog comments powered by Disqus
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 



© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap

Dev Shed Tutorial Topics: