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

select & mono - The requested feature is not implemented. #22

Open
bonesoul opened this issue Sep 2, 2014 · 11 comments
Open

select & mono - The requested feature is not implemented. #22

bonesoul opened this issue Sep 2, 2014 · 11 comments

Comments

@bonesoul
Copy link
Contributor

bonesoul commented Sep 2, 2014

Using csredis with mono.

Using sync client - and select command

                // create the connection
                Client = new RedisClient(_config.Host, _config.Port)
                {
                    ReconnectAttempts = 3,
                    ReconnectWait = 200
                };

Client.Select(_config.DatabaseId);

Getting;


any ideas?

@bonesoul
Copy link
Contributor Author

bonesoul commented Sep 2, 2014

removed the select call but still getting more errors;

18:16:11 [Error] [RedisProvider] [Dogecoin] An exception occured while getting version info: The requested feature is not implemented.
18:16:11 [Error] [RedisProvider] [Dogecoin] Redis storage initialization failed: 10.0.0.13:6379 - Object reference not set to an instance of an object

I was able to use CSRedis with mono with this commit - https://github.com/ctstone/csredis/tree/6667063d156bf04673449996b4f3560918631c4c but seems a change after broke it.

@ctstone
Copy link
Owner

ctstone commented Sep 2, 2014

The latest releases use SocketAsyncEventArgs for faster async
performance... I wonder if Mono supports that?. I'll try to setup a Mono
debug environment to see what's going on.

On Tue, Sep 2, 2014 at 11:18 AM, Hüseyin Uslu notifications@github.com
wrote:

removed the select call but still getting more errors;

18:16:11 [Error] [RedisProvider] [Dogecoin] An exception occured while getting version info: The requested feature is not implemented.
18:16:11 [Error] [RedisProvider] [Dogecoin] Redis storage initialization failed: 10.0.0.13:6379 - Object reference not set to an instance of an object

I was able to use CSRedis with mono with this commit -
https://github.com/ctstone/csredis/tree/6667063d156bf04673449996b4f3560918631c4c
but seems a change after broke it.


Reply to this email directly or view it on GitHub
#22 (comment).

@bonesoul
Copy link
Contributor Author

bonesoul commented Sep 2, 2014

@ctstone
Copy link
Owner

ctstone commented Sep 2, 2014

What version/platform of Mono are you using? I am able to run Select() and Auth() using Mono for Windows 3.2.3 and build 3.2.1 of csredis.

Do you have a full stack trace?

@ctstone
Copy link
Owner

ctstone commented Sep 2, 2014

Ok, I have repro'd on a Linux VM. Here is the offending stack:

System.NotImplementedException: The requested feature is not implemented.
  at System.Net.EndPoint.Serialize () [0x00000] in <filename unknown>:0
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
  at CSRedis.Internal.RedisConnector.Connect () [0x00000] in <filename unknown>:0
  <snip>

Here is the EndPoint.Serialize() definition, and it is indeed undefined:
https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/EndPoint.cs#L49

CSRedis uses a DnsEndpoint which does not override base EndPoint.Serialize():
https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/DnsEndPoint.cs

Mono's Socket.Connect() appears to correctly handle IPEndPoint, which does implement Serialize:
https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/IPEndPoint.cs#L153

Here is the originating Connect() call:
https://github.com/mono/mono/blob/master/mcs/class/System/System.Net.Sockets/Socket_2_1.cs#L1215

@bonesoul
Copy link
Contributor Author

bonesoul commented Sep 2, 2014

what's your mono version?

@bonesoul
Copy link
Contributor Author

bonesoul commented Sep 2, 2014

Is there any fix on your mind? csredis is the only c# redis package that was able to run on linux/mono.

@ctstone
Copy link
Owner

ctstone commented Sep 2, 2014

You can try the Develop branch using your own EndPoint (specifically, an IPEndPoint):

var ep1 = new IPEndPoint(IPAddress.Parse("x.x.x.x"), Port); // via IP
var ep2 = new IPEndPoint(Dns.GetHostEntry("yourname").AddressList[0], Port); // via lookup
var redis = new RedisClient(ep1);

Not quite ready to push these changes to the Master branch, but I'm curious to know if this workaround works for you.

@bonesoul
Copy link
Contributor Author

bonesoul commented Sep 2, 2014

getting this with develop branch;

{"Could not load file or assembly 'csredis, Version=3.1.0.0, Culture=neutral, PublicKeyToken=1afd0264bbe4a44a' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)":"csredis, Version=3.1.0.0, Culture=neutral, PublicKeyToken=1afd0264bbe4a44a"}

bonesoul pushed a commit to CoiniumServ/csredis that referenced this issue Sep 2, 2014
@bonesoul
Copy link
Contributor Author

bonesoul commented Sep 2, 2014

@ctstone , yes endpoint fix worked;

                // for mono compatibility, we need to define an endpoint.
                var endpoint = new IPEndPoint(IPAddress.Parse(_config.Host), _config.Port); 

                // create the connection
                Client = new RedisClient(endpoint)
                {
                    ReconnectAttempts = 3,
                    ReconnectWait = 200
                };

@pracplayopen
Copy link

fwiw still had this issue on mono 4.2.1. workaround fixed it beautifully, thx.

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

3 participants