Unlimited Usenet
day retention, 99% Completion, Unlimited Access, Free Trial!

Any Good Muti-User SOCKET Server examples?

This is a discussion on Any Good Muti-User SOCKET Server examples? within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I've been looking all over the net for decent socket server examples (step-by-step would be nice). I ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-28-2009
the Big H
 
Posts: n/a
Default Any Good Muti-User SOCKET Server examples?


I've been looking all over the net for decent socket server examples
(step-by-step would be nice). I can't seem to find anything that comes
close to handling multiple users as simple as possible. If you find
anything please post it here. Any help would be totally Awesome-O 8 )

thanks in advance.

----------------------------------------
Worlds Funnest Mass Multiplayer Game
http://hexmud.com
telnet://hexmud.com:4000
* Play Now - It's 100% FREE! *
Reply With Quote
  #2 (permalink)  
Old 04-28-2009
mlemos
 
Posts: n/a
Default Re: Any Good Muti-User SOCKET Server examples?

Hello,

on 04/27/2009 10:20 PM the Big H said the following:
>
> I've been looking all over the net for decent socket server examples
> (step-by-step would be nice). I can't seem to find anything that comes
> close to handling multiple users as simple as possible. If you find
> anything please post it here. Any help would be totally Awesome-O 8 )


You may want to take at this PHP class that can handle multiple clients
connecting to multiple sockets at the same time.

http://www.phpclasses.org/supersocket

--

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Reply With Quote
  #3 (permalink)  
Old 04-28-2009
The Natural Philosopher
 
Posts: n/a
Default Re: Any Good Muti-User SOCKET Server examples?

the Big H wrote:
>
> I've been looking all over the net for decent socket server examples
> (step-by-step would be nice). I can't seem to find anything that comes
> close to handling multiple users as simple as possible. If you find
> anything please post it here. Any help would be totally Awesome-O 8 )
>


That's really because its not something you would normally use php for.

If you want to write a daemon, and you are on a Linux platform, the
simplest thing to do is to hook a program into inetd..its been a while,
but that is a multi programmed multi session general purpose daemon that
handles all the nasty stuff and simply invokes your program to deal with
any incoming socketry.

In that sense its pretty similar in general to the way apache hooks into
php.

You get incoming data from the socket passed as stdin, and you write to
stdout, and inetd ensures that goes to and from the TCP/IP socket
specified in /etc/indetd.conf.





> thanks in advance.
>
> ----------------------------------------
> Worlds Funnest Mass Multiplayer Game
> http://hexmud.com
> telnet://hexmud.com:4000
> * Play Now - It's 100% FREE! *

Reply With Quote
  #4 (permalink)  
Old 04-28-2009
C. (http://symcbean.blogspot.com/)
 
Posts: n/a
Default Re: Any Good Muti-User SOCKET Server examples?

On 28 Apr, 02:20, the Big H <ureg...@NOSPAM.com> wrote:
> I've been looking all over the net for decent socket server examples
> (step-by-step would be nice). I can't seem to find anything that comes
> close to handling multiple users as simple as possible. If you find
> anything please post it here. Any help would be totally Awesome-O 8 )
>
> thanks in advance.
>
> ----------------------------------------
> Worlds Funnest Mass Multiplayer Gamehttp://hexmud.com
> telnet://hexmud.com:4000
> * Play Now - It's 100% FREE! *


Not when I last looked: there was lots of code out there but most of
it was buggy or badly written/documented. Most of it was also about
writing client sockets - not server sockets.

I'm in the process of trying to write a server which has to execute as
a single thread with non-blocking I/O (but I don't have any of the
source code to hand). If having it run as a single thread is not a
requirement then I'd recommend using [x]inetd to manage the sockets
and simply have the PHP script using stdio.

I had lots of problems initially when I tried using the stream_
functions most of which just went away when I switched to using the
basic socket_ functions.

HTH

C.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:04 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0