Beispiel #1
0
        private bool CheckUser(string name)
        {
            var user = _remotespace.QueryP("User",
                                           name);

            if (user == null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
        public static void ConnectToServer()
        {
            string serverUrl = "tcp://" + ConnectionInfo.SERVER_ADDRESS + "/" + ConnectionInfo.SPACE_NAME + "?KEEP";

            Console.WriteLine($"Connecting to server at '{serverUrl}'...");

            ISpace space = new RemoteSpace(serverUrl);

            try {
                // Connection is made first time some request is being made
                space.QueryP("disregard this string content");
            }
            catch (SocketException e) {
                Console.WriteLine("Connection to server failed\n");
                throw e;
            }

            Connection.GlobalSpace = space;

            Console.WriteLine("Connection to server succeeded\n");
        }