View Full Version : EQStream and EQStreamFactory
daerath
02-17-2014, 08:19 PM
I've been going through the server code and have a couple of questions around EQStream::Write and EQStreamFactory::WriterLoop.
The Write method limits the number of bytes sent per stream and it looks like the Decay timer in WriterLoop is used to gradually reduce the # of bytes sent. Is the purpose to keep one client from potentially starving the other connected clients, is this to keep from maxing out the server's UDP buffer, or is it a combination or some other reason?
Thank you!
image
02-20-2014, 08:44 AM
I looked over it briefly and this looks like the way the datarate is handled (so we don't throw too much data at the client than their line supports, was big back in dialup days). The client used to be able to set this manually with /datarate it is in this case automated into OP_SessionStatRequest/OP_SessionStatResponse. The decay is removing (every 20ms I guess) the datarate byte count from bytes written to the client. The lower this value is the more likely we are to send new data out (BytesWritten needs to be less than RateThreshold to send out new data).
RateThreshold=1048576/250;
DecayRate=78642/250;
Keep in mind these default values can change inside OP_SessionStatRequest which is also part of EQStream.cpp.
daerath
02-20-2014, 04:08 PM
I looked over it briefly and this looks like the way the datarate is handled (so we don't throw too much data at the client than their line supports, was big back in dialup days). The client used to be able to set this manually with /datarate it is in this case automated into OP_SessionStatRequest/OP_SessionStatResponse. The decay is removing (every 20ms I guess) the datarate byte count from bytes written to the client. The lower this value is the more likely we are to send new data out (BytesWritten needs to be less than RateThreshold to send out new data).
RateThreshold=1048576/250;
DecayRate=78642/250;
Keep in mind these default values can change inside OP_SessionStatRequest which is also part of EQStream.cpp.
Ahh, that makes sense that it's a client provided value. I haven't looked at the OP_SessionStatRequest/Response yet. Glad to know I was in the right ballpark!
Thanks for the response. Back to code spelunking!
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.