/// <summary> /// Constructs a LocalServerImpl object. /// </summary> public LocalServerImpl() { dor = new EmptyDoR(); doi = new EmptyDoI(); syncID = Guid.NewGuid(); server = new SINFONIServer(SINFONIServerManager.Instance.ServerURI, SINFONIServerManager.Instance.ServerPort, "/serversync/", "serverSync.kiara"); Configuration serverSyncConfig = ConfigurationManager.OpenExeConfiguration(this.GetType().Assembly.Location); int syncPort = int.Parse(serverSyncConfig.AppSettings.Settings["serverSyncPort"].Value); service = server.StartService(SINFONIServerManager.Instance.ServerURI, syncPort, "/", "ws", "fives-json"); service.OnNewClient += ServerSyncTools.ConfigureJsonSerializer; RegisterSyncIDAPI(service); }
public SimpleServer() { ITransport websocketTransport = new WebSocketTransport(); TransportRegistry.Instance.RegisterTransport(websocketTransport); IProtocol jsonRpc = new JsonRpcProtocol(); IProtocol fivesJson = new FiVESJsonProtocol(); ProtocolRegistry.Instance.RegisterProtocol(jsonRpc); ProtocolRegistry.Instance.RegisterProtocol(fivesJson); SINFONIServer newServer = new SINFONIServer("localhost", 8080, "/service/", "server.sinfoni"); var service = newServer.StartService("127.0.0.1", 34568, "/service", "ws", "jsonrpc"); service.OnNewClient += new NewClient(HandleNewClient); service["example.addVectors"] = (Func<Vector, Vector, Vector>)addVectors; Console.Read(); }
private void StartSinfoniServer() { SinfoniServer = new SINFONIServer(ServerURI, ServerPort, ServerPath, "fives.kiara"); SinfoniService = SinfoniServer.StartService(ServiceHost, ServicePort, "/service/", ServiceTransport, ServiceProtocol); }