Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StackExchange of C# cannot connect successfully #201

Closed
yorkxiao opened this issue Jul 26, 2017 · 6 comments
Closed

StackExchange of C# cannot connect successfully #201

yorkxiao opened this issue Jul 26, 2017 · 6 comments

Comments

@yorkxiao
Copy link

Great job!
I'm in trouble When connecting to the server using StackExchange client. When connecting, the server output the message 'An existing connection was forcibly closed by the remote host.'
Can you help me? thx!
Here is my code snippet:

using (ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("127.0.0.1:9851"))
{
	IDatabase db = redis.GetDatabase();
	var result = db.Execute("NEARBY", "fleet POINT 33.462 -112.268 6000".Split(' '));
	Console.WriteLine(result);
}
@yorkxiao
Copy link
Author

It is ok when I using redis-cli.
qq 20170726233435

@tidwall
Copy link
Owner

tidwall commented Jul 26, 2017

According to this article you may want to separate the params individually.

db.Execute("NEARBY", "fleet", "POINT", "33.462", "-112.268", "6000");

@yorkxiao
Copy link
Author

Hi, @tidwall , Thank you for your reply. But the error happens on the method "ConnectionMultiplexer.Connect". The error message is :

It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. SocketClosed on PING

If I use ServiceStack.Redis library, the error will be "No master found".

tidwall added a commit that referenced this issue Jul 27, 2017
@tidwall
Copy link
Owner

tidwall commented Jul 27, 2017

I just pushed an update to the master branch that fixes the exception with StackExchange.Redis.

The problem was that the StackExchange client sent an ECHO command while establishing a new connection, and Tile38 didn't know that command so it responded with -ERR unknown command.

I added the ECHO command to Tile38 and now it appears to work better.

@yorkxiao
Copy link
Author

That is great! Thanks!

@tidwall
Copy link
Owner

tidwall commented Jul 28, 2017

You're welcome. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants