static void Main(string[] args) { Debug.Listeners.Add(new TextWriterTraceListener(Console.Out)); var dataSource = new CacheDataService(new MySQLDataService()); //var dataSource = new MemoryDataService(); var server = new EncryptedTcpServer(storeKeysInConfiguration: true); server.AllowAll = true; var auth = new TcpBasicAuthenticationProvider(dataSource); auth.AutoRegisterUsers = true; auth.RegisterHandlersTo(server); var serviceServer = new TcpDataServiceServer(dataSource); serviceServer.RegisterTo(server); serviceServer.RegisterAuthProvider(auth); Console.ReadLine(); server.Dispose(); dataSource.Dispose(); }
static void Main(string[] args) { Debug.Listeners.Add(new TextWriterTraceListener(Console.Out)); DataServiceBase service = new TcpDataService(new TcpClient("home.sorenhk.dk")); service = new CacheDataService(service); var tcpServer = new TcpServer(); var server = new TcpDataServiceServer(service); server.RegisterTo(tcpServer); Console.ReadLine(); tcpServer.Dispose(); service.Dispose(); }