Re: [CODE] Stuck with recieving data from descriptor....

From: Pure Krome (spam@world-domination.com.au)
Date: 06/16/01


Heya all (again) ;)

Sorry to keep this thread alive, but I just wanted to add another senario to
my poor effort so far.


In my previous email to this thread, i said that Daniel got me inspired to
solving his APPEND BUFFER solution.

Well, after I jumped in a started modifing my code, i realised a major flaw
with it -> how does the CLIENT KNOW, when it has recieved ALL THE PACKETS
for the particular response?

Example.
Lets say my client sends the following request to the mud :-
cl_mortal_list

The client_interpreter now goes OH! you want a list of all the mortals
online ... hmm. ok .. here's the XML data of them.

My client then goes .. kewl! and it recieved X number of packets, appending
each packet to a global string which i know we don't have the first packet
(Ie. CLIENT_OK or CLIENT_ERROR).

Problem is now, when do i know i've recieved that last packet? I need to
wait for another response from the server which will be a FIRST PACKET
RESPONSE.

So then i thought, just APPEND the text [CLIENT_END] to the end of each
text, and when my buffered text contains that, then i can proceede.

Hmm ... not a bad idea. But still i don't like the idea of a packet spliting
up THAT TEXT ;)

So then i thought, i could change my protocol to -> <STATUS><SIZE_OF_TEXT>
<TEXT>

example of client side returned data....
[CLIENT_OK][51] Welcome to Eternal Visions MUD - Client.
[CLIENT_OK][9] Username:
[CLIENT_OK][10] Password:
[CLIENT_OK][10] Connected.
[CLIENT_ERROR][35] Interpreter :: No command detected.

....


So now i know that if my buffered text is NOT / LESS THAN  the size of the
response text, we keep buffering ;)


Just thought i might further this thread for those interested.

-Jussy-

-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
Everan Roseblade                              Everan@EternalVisions.com
Eternal Visions Mud   eternalvisions.com:1200    www.eternalvisions.com
-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/05/01 PST