ServiceStack.Redis: Unable to Connect: sPort: 0

后端 未结 2 1098
一个人的身影
一个人的身影 2021-01-12 14:45

Sometimes (not always) I am getting

\"Unable to Connect: sPort: 0\"

error when trying to get value from Redis when using ServiceStack.Redis. Does anyone kno

相关标签:
2条回答
  • 2021-01-12 15:31

    I believe you can fix this by increasing the pool's ConnectTimeout. I had it set very low (10ms), so when the pool was created, some of the clients were unable to connect in that short period. If the pool returned one of these clients, it would throw this error (the "0" port is because it's not connected -- it doesn't know what port it's not connected to). After a delay, all of the clients are able to connect.

    I increased my connect timeout to 500ms, and the problem went away -- the clients all connect, though some of them block for a couple hundred milliseconds. But that's much better than an error.

    0 讨论(0)
  • 2021-01-12 15:45

    It might mean that the port number or host address is wrong.

    0 讨论(0)
提交回复
热议问题