Ejemplo n.º 1
0
        public IListener Verify()
        {
            var socket = _protocolSender.Connect(_hostName, _port);

            if (socket == null)
            {
                //TODO
                throw new InvalidOperationException("Could not connect to the server");
            }

            var isSendTopicSuccessful = _protocolSender.Send(socket, $"Type=subscribe Body={_topic}<EOF>");

            if (!isSendTopicSuccessful)
            {
                //TODO
                throw new InvalidOperationException("Could not subscribe to the topic");
            }

            _serverSocket = socket;

            return(this);
        }