public int Send(ISerializable message, DeliveryOptions deliveryOptions, Guid peer)
        {
            var stream = _shamanStreamPool.Rent(message.GetType());

            try
            {
                _serializer.Serialize(message, stream);
                _roomSender.Send(new Payload(stream.GetBuffer()), deliveryOptions, peer);
                return((int)stream.Length);
            }
            finally
            {
                _shamanStreamPool.Return(stream, message.GetType());
            }
        }
예제 #2
0
 public void Send(Payload payload, DeliveryOptions deliveryOptions, Guid sessionId)
 {
     _roomSender.Send(payload, deliveryOptions, sessionId);
 }