Пример #1
0
        public async Task <TOut> SendReceiveAsync <TIn, TOut>(string identifier, TIn message, int replyTimeout = 0)
        {
            var rawMessage = _serializer.Serialize(identifier, message);

            if (rawMessage == null)
            {
                return(default(TOut));
            }
            var rawResponse = await _simplSocketClient.SendReceiveAsync(rawMessage);

            if (rawResponse == null)
            {
                return(default(TOut));
            }
            var response = _serializer.Deserialize <TOut>(rawResponse.Content);

            rawResponse.Dispose();
            if (response == null)
            {
                return(default(TOut));
            }
            return(response);
        }