예제 #1
0
        /// <summary>
        /// Handshakes with the remote agent.
        /// </summary>
        public void Handshake()
        {
            // Construct a new request header.
            var header = new RequestHeader()
            {
                Command = SerfCommand.Handshake,
                Seq     = this.GetSeq()
            };

            var req = new HandshakeRequest()
            {
                Version = 1
            };

            this.Send <HandshakeRequest>(header, req);
        }
예제 #2
0
        /// <summary>
        /// Authenticates with the provided key.
        /// </summary>
        /// <param name="authKey">The key to use for authentication.</param>
        public void Authenticate(string authKey)
        {
            // Construct a new request header.
            var header = new RequestHeader()
            {
                Command = SerfCommand.Auth,
                Seq     = this.GetSeq()
            };

            var req = new AuthRequest()
            {
                AuthKey = authKey
            };

            // Send the request
            this.Send <AuthRequest>(header, req);
        }