Cyph wrote: |
ASCII and TCP, making it very easy for anyone to program a client. |
Cyan~Fire wrote: |
[..]
I personally prefer a packet, I mean, what's easier than filling in a struct? Computers aren't designed to work with strings, they're designed to work with numbers. |
Code: Show/Hide A sends AAA, then BBBB, then CCCCC.
Network sends packet AAA. Network sends packet BBBB. Network sends packet CCCCC. B receives packet AAA. B receives packet CCCCC. B never knows about packet BBBB. |
Code: Show/Hide A sends AAA, then BBBB, then CCCCC.
Network sends packet AA. B receives packet AA. Acks it. AA data passed to application. Network sends packet ABBBBC. Network sends packet CCC. Network sends packet C. B receives packet CCC. Acks it. Network resends packet ABBBBC. B receives packet ABBBBC. Acks it. ABBBBCCCC data passed to application. B receives packet C. Acks it. C data passed to application. A never receives ack for packet C. Network resends packet C. B receives packet C. Acks it again. Ignores data since that id already processed. |
Code: Show/Hide Send AAA, BBB, CCC, DDD, EEE
Recv AAA, BBB, CCC, DDD, EEE |
Code: Show/Hide Send AAA, BBB, CCC, DDD, EEE
Recv A, AAB, BBCCCD, D, DEEE |
Code: Show/Hide Send 3AAA, 3BBB, 3CCC, 3DDD, 3EEE
Recv 3A, AA3B, BB3CCC3D, D, D3EEE |
Code: Show/Hide char *token = strtok(message, ":\n");
if (strcmp(token, "SEND") == 0) { strtok(NULL, ":\n" if (strcmp(token, "PUB") == 0) //and so on... } |
Code: Show/Hide switch (id)
{ case ID_send: { int type = //something.... switch (type) { case TYPE_pub: //etc } } } |
Smithy101 wrote: |
I think Mr Ekted likes explaining this ![]() |