Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-05-2003, 08:45 AM
Joolz
Fire Beetle
 
Join Date: Jan 2003
Posts: 25
Default Little Optimization

in EQNetwork.cpp... change EQNetworkServer::RecvData to this:

Its only a little swap around, but should make new connections on high load servers handle better. Also, keeps the memory footprint down a little by scoping a few things.

Code:
void EQNetworkServer::RecvData(uchar* data, int32 size, int32 irIP, int16 irPort) {

	if (data[0] & 0x20) { // check for SEQStart
		#if EQN_DEBUG >= 4
			cout << "New EQNetwork Connection." << endl;
		#endif
		EQNetworkConnection* tmp = new EQNetworkConnection(irIP, irPort);
		tmp->RecvData(data, size);
		(*list).Append(tmp);
		MNewQueue.lock();
		NewQueue.push(tmp);
		MNewQueue.unlock();
	}
	else {
		// Ok, its not a new connection do this iteration
		LinkedListIterator<EQNetworkConnection*> iterator(*list);

		iterator.Reset();
		while (iterator.MoreElements()) {
			if (iterator.GetData()->IsMine(irIP, irPort)) {
				iterator.GetData()->RecvData(data, size);
				return;
			}
			iterator.Advance();
		}
	}
}
(edited, because there were one too many returns )
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 06:15 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3