in reply to Reading and writing sockets
Example, each transmission looks like:
so yer server can say action:0008:fly away or better yet, create a hash liketype:length:message
that way, you can say "001:0008:fly away" parse your protocol by reading in the first 3 + 1 + 4 characters, doing something like my($action,$length)=split/:/ and the reading $length bytes... I hope you get the picturemy %ACTIOn = ( '000' => 'not an action', '001' => 'jump', '002' => 'swim',....
____________________________________________________
** The Third rule of perl club is a statement of fact: pod is sexy.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (podmaster) Re: Reading and writing sockets
by Marcello (Hermit) on Dec 11, 2001 at 14:27 UTC | |
by PodMaster (Abbot) on Dec 11, 2001 at 14:57 UTC |