News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Christoph Hochstrasser:
PHP Socket Programming, done the Right Way (tm)
August 01, 2012 @ 10:16:15

In one of his recent posts Christoph Hochstrasser looks at socket programming done the right way, complete with code examples showing both client and server setups.

When writing about socket programming with PHP, nearly all articles are about the Socket Extension, despite it's the unfriendliest and most cumbersome way to work with Sockets in modern PHP. Let me introduce you to something, which apparently is pretty unknown among PHP programmers.

He starts off by introducing the concept of a socket (for those that are beginners on the topic) and talks about two of the major ways to work with them - the Socket extension and Streams. He shows how to use the stream_socket_client_* functions to connect to a remote server and make a HTTP request for the base page. He also shows the other side of things, making a simple "echo" server that binds to port 1337.

0 comments voice your opinion now!
socket programming extension tutorial client server


blog comments powered by Disqus

Similar Posts

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 11)

Refulz.com: Traits - Method Precedence and Conflict resolution

Script-Tutorials.com: How to Use APC Caching with PHP

The Bakery: Nine New Tutorials, Helpers and Plugins for CakePHP

SitePoint PHP Blog: Introduction to Gearman - Multitasking in PHP


Community Events





Don't see your event here?
Let us know!


list voicesoftheelephpant library api opinion symfony interview tips introduction release language deployment podcast series laravel bugfix install package framework community

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework