PHP Developers Network
http://forums.devnetwork.net/

How To Understand PHP Sockets Programming
http://forums.devnetwork.net/viewtopic.php?f=1&t=140574
Page 1 of 1

Author:  PHPHelpNeeded [ Tue Nov 18, 2014 9:22 am ]
Post subject:  How To Understand PHP Sockets Programming

Hi,

Please note: if you are an experience php programmer, I am asking that you be patient since I don't have a code sample. My question is not a bout code error, is about how sockets work (interaction mechanics).

I am completely new to PHP, but because I am trying to learn PHP now, and with it, I want to write a video game.

I am still a little confused about Sockets.

For instance, I found this tutorial: http://www.binarytides.com/php-socket-p ... -tutorial/ that explains a lot about sockets.

I do understand the basics of how sockets work, since I have done socket programming in JAVA.

But this time I want to learn how to maintain a website in PHP which accepts socket connection from many clients, since it will be a video game.

So if anyone goes over the tutorial I posted in the link above, you will notice that the person who explained it used TELNET to test the server and client sockets.

This is my question, in php, when you write socket programming, the clients, do they have to run on telnet, for instance, if I am running the server in telenet can the clients (running NOT as a TELNET instance) run as web php page, and still read and send (relay) information to the server? Can someone try to explain this, that's what I am trying to understand?

Thanks.

Author:  Weirdan [ Tue Nov 18, 2014 10:28 am ]
Post subject:  Re: How To Understand PHP Sockets Programming

Telnet is just a client program in this case. It's used for demonstration purposes because it's ubiquitous. In real life you would use a real client, either pre-existing or written by you.

Author:  PHPHelpNeeded [ Tue Nov 18, 2014 12:26 pm ]
Post subject:  Re: How To Understand PHP Sockets Programming

Let rephrase the question, but do you need telnet to run either the server or the client php programs?

Like for instance, can I run the server sockets in one internet browser window from the computer that runs the web server, and then the client from another computer that wants to access the website and wants to communicate with the server that is running?

Author:  Weirdan [ Wed Nov 19, 2014 9:31 am ]
Post subject:  Re: How To Understand PHP Sockets Programming

No, telnet is not needed.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/