• Welcome to Valhalla Legends Archive.
 

Maximum length on BNCS packet from server

Started by MyndFyre, June 20, 2008, 12:26 AM

Previous topic - Next topic

MyndFyre

Does anyone know if there's a maximum length on a server packet?

[edit]While we're at it, how about to the server?  Isn't that one 224?
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Barabajagal

#1
224 is the maximum amount of text that can be sent in the chat command, not the maximum packet size. I think the best way to get an answer would be with the readuserdata packet... see if you can request all known records, then try them all twice in the same packet... etc...

Edit: Scratch that, it allows up to 32 requests apparently, regardless of packet length. I'm going with 1460 bytes.

MyndFyre

QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

iago

To be on the safe side, I'd go with 65536 bytes. It can't possibly be longer than that.

Relying on 1460 is probably a bad idea, since that might just be a convention and they might eventually add something that goes higher.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Ringo

Best bet would be to send a micky mouse packet, like "FF 10 00 70" to see if the server does nothing (waits for the rest of the packet body) or disconnects you, then toy around with the lengh and see if it has a fit over a set lengh.
Thats what I would probly do anyway :p

MyndFyre

Quote from: iago on June 20, 2008, 08:27 AM
To be on the safe side, I'd go with 65536 bytes. It can't possibly be longer than that.

Relying on 1460 is probably a bad idea, since that might just be a convention and they might eventually add something that goes higher.


What I'm actually trying to do is preallocate and pool buffers on the client.  I noticed when I was working on my WoW client that, when I attached a profiler, about 70% of my total memory usage was on byte[] objects.  Since it's expensive to garbage-collect them, I figure, why not just keep them alive and reuse them?

For sending, I think it's safe to cap at 1460 (right now I'm actually capping at 768 based on this feedback).  Incoming data I'm capping at 2048.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

iago

Quote from: MyndFyre[vL] on June 20, 2008, 10:56 AM
For sending, I think it's safe to cap at 1460 (right now I'm actually capping at 768 based on this feedback).  Incoming data I'm capping at 2048.
Although it might make the code a little more opaque, you should handle the situation where packets are longer, just in case.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


MyndFyre

Quote from: iago on June 20, 2008, 01:25 PM
Quote from: MyndFyre[vL] on June 20, 2008, 10:56 AM
For sending, I think it's safe to cap at 1460 (right now I'm actually capping at 768 based on this feedback).  Incoming data I'm capping at 2048.
Although it might make the code a little more opaque, you should handle the situation where packets are longer, just in case.


I am; I'm throwing ProtocolViolationException.  ;-)
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

iago

I meant, handle them properly.

Sending a longer packet isn't a violation of the protocol.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*