amy_888 发表于 2015-7-21 06:11:13

ServiceStack.Redis RedisNativeClient Vs Redis-Sharp

  

ServiceStack.Redis



    private void Connect()
      {
            socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
            {
                SendTimeout = SendTimeout
            };
            try
            {
                socket.Connect(Host, Port);
                if (!socket.Connected)
                {
                  socket.Close();
                  socket = null;
                  return;
                }
                Bstream = new BufferedStream(new NetworkStream(socket), 16 * 1024);
                if (Password != null)
                  SendExpectSuccess(Commands.Auth, Password.ToUtf8Bytes());
                db = 0;
                var ipEndpoint = socket.LocalEndPoint as IPEndPoint;
                clientPort = ipEndpoint != null ? ipEndpoint.Port : -1;
                lastCommand = null;
                lastSocketException = null;
                LastConnectedAtTimestamp = Stopwatch.GetTimestamp();
                if (isPreVersion1_26 == null)
                {
                  isPreVersion1_26 = this.ServerVersion.CompareTo("1.2.6")
页: [1]
查看完整版本: ServiceStack.Redis RedisNativeClient Vs Redis-Sharp