/// <summary>
/// Send the outgoing buffer.
/// </summary>
public void EndSend (bool reliable)
{
mBuffer.EndPacket();
#if UNITY_WEBPLAYER
mTcp.SendTcpPacket(mBuffer);
#else
if (reliable || !mUdpIsUsable || mServerUdpEndPoint == null || !mUdp.isActive)
{
mTcp.SendTcpPacket(mBuffer);
}
else mUdp.Send(mBuffer, mServerUdpEndPoint);
#endif
mBuffer.Recycle();
mBuffer = null;
}
/// <summary>
/// Broadcast the outgoing buffer to the entire LAN via UDP.
/// </summary>
public void EndSend (int port)
{
mBuffer.EndPacket();
#if !UNITY_WEBPLAYER
mUdp.Broadcast(mBuffer, port);
#endif
mBuffer.Recycle();
mBuffer = null;
}
/// <summary>
/// Send this packet to a remote UDP listener.
/// </summary>
public void EndSend (IPEndPoint target)
{
mBuffer.EndPacket();
#if !UNITY_WEBPLAYER
mUdp.Send(mBuffer, target);
#endif
mBuffer.Recycle();
mBuffer = null;
}