Exemplo n.º 1
0
        //Should be in lock when doing this
        private void RequestServerStreamingMap(Server server)
        {
            string serverId = server.Id;
            var uri = new UriBuilder { Path = String.Format("pools/default/bucketsStreaming/{2}", server.HostName, server.StreamingPort, _bucketName) };

            var streamingCommand = new LineReadingHttpCommand(uri, null, (json, _) => OnServerStreamMapUpdated(serverId, json), (response, value, state) => { });
            server.StreamingHttpClient.TrySend(streamingCommand);
        }
Exemplo n.º 2
0
        public static Server EnsureServer(Cluster cluster, string hostname, int memcachedPort)
        {
            var id = Server.GetId(hostname, memcachedPort);
            var server = cluster.GetServerById(id);
            if (server == null)
            {
                server = new Server(hostname, memcachedPort);
                cluster.AddServer(server);
            }

            return server;
        }
Exemplo n.º 3
0
 public ReconnectAttempt(TcpClient tcpClient, Server server)
 {
     TcpClient = tcpClient;
     Server = server;
 }