Desconecta o cliente do servidor
Sintaxe
oReisdClient:Disconnect()
Observações
O método ::Disconnect()
permite que um cliente interrompa sua conexão com um servidor Redis. Isto permite que sejam liberados recursos alocados para conexão tanto no servidor quanto no cliente.
Deste modo, o servidor Redis pode atender a outros clientes.
Naturalmente, uma desconexão só faz sentido caso o cliente tenha de fato conseguido se conectar.
Exemplos
#include 'protheus.ch' #define STD_REDIS_PORT 6379 #define DEFAULT_REDIS_AUTH "" // Setup Redis Static cRedisHost := "localhost" User Function WoAuth() Local cMsg := '' // Creation of client object oRedisCli := tRedisClient():New() // Connection to the server, using default port 6379 oRedisCli:Connect(cRedisHost, STD_REDIS_PORT) If oRedisCli:lConnected cMsg := "Successful connection to the server " + cRedisHost + ", at port " cMsg += cValToChar(STD_REDIS_PORT) + ", with authentication '" + DEFAULT_REDIS_AUTH + "'" ConOut(cMsg) oRedisCli:Disconnect() ConOut("The client disconnected from the server.") Return .T. EndIf cMsg := "Could not connect to the server " + cRedisHost + ", at port " cMsg += cValToChar(STD_REDIS_PORT) + ", with authentication '" + DEFAULT_REDIS_AUTH + "'" ConOut(cMsg) Return .F.
Visão Geral
Import HTML Content
Conteúdo das Ferramentas
Tarefas