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; }
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(); }
/// <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; }