This is basically a continuation of a privious question...
I've got a decent system of reading the packets and using methods of handling the data, but now I need a good way of handling disconnects from the server end. (abnormal or whatever)
I cannot modify the server in anyway, but every packet begins with...
StartPacket : Byte; //always $FF
PacketID : Byte; //function
PacketLength : Word; // including header
PacketData : array[PacketLength-4] of byte
I am now, with good suggestions for jacco, using a consts file that contains all the packet ID's and a variable that holds the names of methods that can be searched searched for and run...
SID_NULL = $00;
SID_CLIENTID = $05;
BNET_HeaderNames: array[Byte] of string;
TID] := 'SID_CLIENTID';
It currently has threadsafe methods of writing packets from outside the thread. I am basically looking for more ideas and suggestions.
What I really need is a good way to terminate the connection. Should I just .free the reader thread and indy client or is there a better way?
PS, I don't like just links to commonly known sites. I like examples and detailed suggestions.
I will be awarding points appropriately. Some points are owed to a contributor in "Part 1", but I will still give to others who contribute. Soon as there is enough useful information in this topic, I will make a "Part 3" and continue on from there.