#include 'protheus.ch'
#define DEFAULT_REDIS_PORT 6379
// Setup Redis
Static cRedisHost := "tec-clima"
Static cRedisAuth := ""
User Function redTst()
Local cMsg := ''
// Creation of client object
oRedisCli := tRedisClient():New()
// Connection to the server, using default port 6379
oRedisCli:Connect(cRedisHost, , cRedisAuth)
If oRedisCli:lConnected)
ConOut("Successful connection.")
oRdClient:Disconnect()
ConOut("The client disconnected from the server.")
Return .T.
EndIf
cMsg := "Could not connect to the server " + cRedisHost + ", at port "
cMsg += cValToChar(6379) + ", with authentication '" + cRedisAuth + "'"
ConOut(cMsg)
Return .F. |