From: Arne R. <arn...@gm...> - 2004-08-17 23:01:41
|
Hi, > due to a severe bug in the WNetwork I released a new version that has some > changes. The bug was that if more than one packet was sent to the server, for > example, it received them as if they were one packet. Well, uh, I don't think, that was a bug. > Therefore WNetwork now > implements a packet separator (which is \n\r\t , but that's only internally > important) and splits the received data into the original packets. Incomplete > packets are stored and concantenated. Ok, you add this seperator, but you don't mask this sequence. If a client (or server) wants to send this sequence, it will never reach its destination because it's filtered out and the data around this sequence is splitted into two packets which can cause more problems than with out this splitting. > This involves changes in the interface of > WNetwork: > > - ClientParse() and ServerParse() must take a packet (string) as second argument. That is quite ok, even without this new mechanism. But... did you ever think of other clients? For example a telnet client for testing would have no chance to send anything to the server (or do you have a key on your keyboard that produces \n\r?). I think, your wnetwork class is the wrong place to put this seperating feature. These seperating feature is part of the syntax of all data over network. So the only instance that is allowed to produce this seperator is the same that is responsible for the rest of the syntax - and that is not your wrapping class. In CNetwork, this is already implemented. The seperating character is a simple \n, which is part of the syntax and which can be produced by every telnet client. cya arne |