PHP - Sockets

From LXF Wiki

(Difference between revisions)
Revision as of 03:05, 18 Nov 2010
Egecakibi (Talk | contribs)

← Go to previous diff
Current revision
M-Saunders (Talk | contribs)
Reverted edit of Egecakibi, changed back to last version by Guy
Line 1: Line 1:
->= Practical PHP Programming =+= Practical PHP Programming =
''(Original version written by Paul Hudson for Linux Format magazine issue 47.)'' ''(Original version written by Paul Hudson for Linux Format magazine issue 47.)''
Line 10: Line 10:
But first, let me explain what a socket actually is. Perhaps the best way to think of a socket is like a connector, and might be between a program and a port, or perhaps two programs - data goes in one end, and comes out the other end. There's a lot more to sockets beyond that, but it's not important on the whole - at least not for this instalment. But first, let me explain what a socket actually is. Perhaps the best way to think of a socket is like a connector, and might be between a program and a port, or perhaps two programs - data goes in one end, and comes out the other end. There's a lot more to sockets beyond that, but it's not important on the whole - at least not for this instalment.
- 
----- 
-<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"> 
----- 
-=[http://ehivemit.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]= 
----- 
-=[http://ehivemit.co.cc CLICK HERE]= 
----- 
-</div> 

Current revision

Practical PHP Programming

(Original version written by Paul Hudson for Linux Format magazine issue 47.)


Sockets are good for all sorts of things beyond just connecting the iron into. Want to revolutionise your PHP scripts? We plug you in...


Files are files, directories are files, and devices are files. Everything, and, conversely nothing (think /dev/null), is a file. So it should come as no surprise to you that sockets are files also, and the logical extension of that fact is that you can manipulate files and sockets in precisely the same way.

But first, let me explain what a socket actually is. Perhaps the best way to think of a socket is like a connector, and might be between a program and a port, or perhaps two programs - data goes in one end, and comes out the other end. There's a lot more to sockets beyond that, but it's not important on the whole - at least not for this instalment.