예제 #1
0
        public RPTester()
        {
            var serverEndpoint = new IPEndPoint(IPAddress.Loopback, 12000);
            var serverID       = PrivateIdentity.Create();

            server    = new RPServer(serverID, serverEndpoint, this);
            listening = server.ListenForClients();

            var clientID = PrivateIdentity.Create();

            client = RPClient.CreateAndConnect(serverID.ID, serverEndpoint, clientID).Result;
        }
예제 #2
0
파일: Program.cs 프로젝트: chronos38/SWE2
        static void Main(string[] args)
        {
            CommandDictionary.Instance.RegisterCommand("CommandContact", new CommandContact());
            CommandDictionary.Instance.RegisterCommand("CommandUpsert", new CommandUpsert());
            CommandDictionary.Instance.RegisterCommand("CommandGetCompanies", new CommandGetCompanies());
            CommandDictionary.Instance.RegisterCommand("CommandInvoice", new CommandInvoice());
            CommandDictionary.Instance.RegisterCommand("CommandDeleteCompany", new CommandDeleteCompany());
            CommandDictionary.Instance.RegisterCommand("CommandSearchCompany", new CommandSearchCompany());
            CommandDictionary.Instance.RegisterCommand("CommandSetCompany", new CommandGetCompany());
            DatabaseFactory.SetType <Database>();
            RPServer rs        = new RPServer(12345, 2);
            Thread   runThread = new Thread(rs.Run);

            runThread.Start();
            Console.ReadKey();
            runThread.Abort();
            rs.Dispose();
        }
예제 #3
0
 /// <summary>
 /// Creates a new instance of a LocalAPIGateway.
 /// </summary>
 public APITranslationServer(PrivateIdentity self, IPEndPoint endPoint, API gateway)
 {
     server   = new RPServer(self, endPoint, this);
     this.api = gateway;
 }