Throttle.cc (9230:33eb3c8a98b9) | Throttle.cc (9275:ef43e69c837a) |
---|---|
1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 246 unchanged lines hidden (view full) --- 255 ccprintf(out, "[%i bw: %i]", m_node, getLinkBandwidth()); 256} 257 258int 259network_message_to_size(NetworkMessage* net_msg_ptr) 260{ 261 assert(net_msg_ptr != NULL); 262 | 1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 246 unchanged lines hidden (view full) --- 255 ccprintf(out, "[%i bw: %i]", m_node, getLinkBandwidth()); 256} 257 258int 259network_message_to_size(NetworkMessage* net_msg_ptr) 260{ 261 assert(net_msg_ptr != NULL); 262 |
263 int size = RubySystem::getNetwork()-> 264 MessageSizeType_to_int(net_msg_ptr->getMessageSize()); | 263 int size = Network::MessageSizeType_to_int(net_msg_ptr->getMessageSize()); |
265 size *= MESSAGE_SIZE_MULTIPLIER; 266 267 // Artificially increase the size of broadcast messages 268 if (BROADCAST_SCALING > 1 && net_msg_ptr->getDestination().isBroadcast()) 269 size *= BROADCAST_SCALING; 270 271 return size; 272} | 264 size *= MESSAGE_SIZE_MULTIPLIER; 265 266 // Artificially increase the size of broadcast messages 267 if (BROADCAST_SCALING > 1 && net_msg_ptr->getDestination().isBroadcast()) 268 size *= BROADCAST_SCALING; 269 270 return size; 271} |