On 04/04/2011 02:44 PM, Kevin Fishburne wrote: > On 04/04/2011 04:20 AM, Benoît Minisini wrote: >> >> You should better decode the packet directly with READ instructions. > > I would except the incoming transactions aren't processed immediately. > They are stored in sequence by ID in a transaction queue array for later > processing. Each client stores 256 server transactions and the server > stores 256 client transactions for up to 2000 clients. That's why the > payload has to stay a string until it is processed; otherwise it would > have no way of being stored in an array. >
Alright, I've transformed all the networking code to the suggested solution, and it's so close to working I can smell it. While there is more code now, I like it better as it's easier to read (important!). Some code: Dim id As Byte Dim type As Byte Dim data As String id = Read #udp As Byte type = Read #udp As Byte If Eof(udp) = False Then data = Read #udp, Lof(udp) - 2 Using "Lof(udp) - 2" as the length seems to remove bytes from the end rather than the beginning. I get an unwanted byte at the beginning as well. Maybe this is a late April Fools joke about endianness? Other than that, the whole app is ready to put pixels on the screen again. -- Kevin Fishburne Eight Virtues www: http://sales.eightvirtues.com e-mail: sa...@eightvirtues.com phone: (770) 853-6271 ------------------------------------------------------------------------------ Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user