c# - Booksleeve, error thrown when trying to open connection after connection was closed -
i cannot re-connect redis db doing following:
- create new
redisconnectioncalled "connection" - open connection
connection.open().wait(); - close connection
connection.close(true); - now when attempt
connection.open().wait();error thrown "connection closed".
i aware connection closed why cannot re-open it?
the same happens if instead of close connection, shut down redis server, let client raise closed event, re-start server, , attempt open connection connection.open().wait(); again. "connection closed" error thrown.
what wrong approach? not seem able manage connection states booksleeve.
thanks
it not expected usage open , close booksleeve connection.
- since multiplexer, expected opened once , used multiple callers concurrently (it thread-safe etc)
- opening involves various handshakes (at both network , protocol levels) ensure correct operation - best avoided (it isn't insanely expensive, note)
- no ongoing state viable once closed; night use brand new connection if want close it
personally i'd close if reconfiguring system @ runtime, or connection broke.
Comments
Post a Comment