[ENet-discuss] Is this a bug?

Ray rguo at jdl.ac.cn
Thu Jul 12 18:31:03 PDT 2007


Hi every one:
	In function static ENetPeer *  enet_protocol_handle_connect, when calculate the windowSize

 if (host -> outgoingBandwidth == 0 &&
        currentPeer -> incomingBandwidth == 0)
      currentPeer -> windowSize = ENET_PROTOCOL_MAXIMUM_WINDOW_SIZE;
    else
      currentPeer -> windowSize = (ENET_MIN (host -> outgoingBandwidth, currentPeer -> incomingBandwidth) /
                                    ENET_PEER_WINDOW_SIZE_SCALE) * 
                                      ENET_PROTOCOL_MINIMUM_WINDOW_SIZE;

 if (currentPeer -> windowSize < ENET_PROTOCOL_MINIMUM_WINDOW_SIZE)
      currentPeer -> windowSize = ENET_PROTOCOL_MINIMUM_WINDOW_SIZE;
    else
    if (currentPeer -> windowSize > ENET_PROTOCOL_MAXIMUM_WINDOW_SIZE)
      currentPeer -> windowSize = ENET_PROTOCOL_MAXIMUM_WINDOW_SIZE;

if outgoingBandwidth is 0 but currentPeer->incomingBandwidth is not 0, then the windowSize will be ENET_PROTOCOL_MINIMUM_WINDOW_SIZE, is that the thing we want?

Best Regards!
Ray





More information about the ENet-discuss mailing list