Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
aab404ad
Commit
aab404ad
authored
May 06, 2014
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tell mono folks why their DNS-based connect fails, and what to do about it
parent
aecbdea6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
6 deletions
+24
-6
Program.cs
BasicTest/Program.cs
+2
-2
EndPointCollection.cs
...kExchange.Redis/StackExchange/Redis/EndPointCollection.cs
+9
-1
SocketManager.cs
StackExchange.Redis/StackExchange/Redis/SocketManager.cs
+11
-1
monobuild.bash
monobuild.bash
+1
-1
monobuild.cmd
monobuild.cmd
+1
-1
No files found.
BasicTest/Program.cs
View file @
aab404ad
...
...
@@ -26,8 +26,8 @@ static void Main(string[] args)
MassiveBulkOpsAsync
(
AsyncOpsQty
,
false
,
false
);
}
static
void
MassiveBulkOpsAsync
(
int
AsyncOpsQty
,
bool
preserveOrder
,
bool
withContinuation
)
{
using
(
var
muxer
=
ConnectionMultiplexer
.
Connect
(
"
127.0.0.
1"
))
{
using
(
var
muxer
=
ConnectionMultiplexer
.
Connect
(
"
localhost,resolvedns=
1"
))
{
muxer
.
PreserveAsyncOrder
=
preserveOrder
;
RedisKey
key
=
"MBOA"
;
...
...
StackExchange.Redis/StackExchange/Redis/EndPointCollection.cs
View file @
aab404ad
...
...
@@ -67,7 +67,15 @@ protected override void InsertItem(int index, EndPoint item)
protected
override
void
SetItem
(
int
index
,
EndPoint
item
)
{
if
(
item
==
null
)
throw
new
ArgumentNullException
(
"item"
);
int
existingIndex
=
IndexOf
(
item
);
int
existingIndex
;
try
{
existingIndex
=
IndexOf
(
item
);
}
catch
(
NullReferenceException
)
{
// mono has a nasty bug in DnsEndPoint.Equals; if they do bad things here: sorry, I can't help
existingIndex
=
-
1
;
}
if
(
existingIndex
>=
0
&&
existingIndex
!=
index
)
throw
new
ArgumentException
(
"EndPoints must be unique"
,
"item"
);
base
.
SetItem
(
index
,
item
);
}
...
...
StackExchange.Redis/StackExchange/Redis/SocketManager.cs
View file @
aab404ad
...
...
@@ -122,7 +122,17 @@ internal SocketToken BeginConnect(EndPoint endpoint, ISocketCallback callback)
var
socket
=
new
Socket
(
AddressFamily
.
InterNetwork
,
SocketType
.
Stream
,
ProtocolType
.
Tcp
);
SetFastLoopbackOption
(
socket
);
socket
.
NoDelay
=
true
;
socket
.
BeginConnect
(
endpoint
,
EndConnect
,
Tuple
.
Create
(
socket
,
callback
));
try
{
socket
.
BeginConnect
(
endpoint
,
EndConnect
,
Tuple
.
Create
(
socket
,
callback
));
}
catch
(
NotImplementedException
ex
)
{
if
(!(
endpoint
is
IPEndPoint
))
{
throw
new
InvalidOperationException
(
"BeginConnect failed with NotImplementedException; consider using IP endpoints, or enable ResolveDns in the configuration"
,
ex
);
}
throw
;
}
return
new
SocketToken
(
socket
);
}
internal
void
SetFastLoopbackOption
(
Socket
socket
)
...
...
monobuild.bash
View file @
aab404ad
...
...
@@ -3,7 +3,7 @@ rm -rf BasicTest/bin/mono
mkdir
-p
StackExchange.Redis/bin/mono
mkdir
-p
BasicTest/bin/mono
echo
-e
"Building StackExchange.Redis.dll ..."
mcs
-recurse
:StackExchange.Redis/
*
.cs
-out
:StackExchange.Redis/bin/mono/StackExchange.Redis.dll
-target
:library
-unsafe
+
-o
+
-r
:System.IO.Compression.dll
-d
:MONO
mcs
-recurse
:StackExchange.Redis/
*
.cs
-out
:StackExchange.Redis/bin/mono/StackExchange.Redis.dll
-target
:library
-unsafe
+
-o
+
-r
:System.IO.Compression.dll
echo
-e
"Building BasicTest.exe ..."
mcs BasicTest/Program.cs
-out
:BasicTest/bin/mono/BasicTest.exe
-target
:exe
-o
+
-r
:StackExchange.Redis/bin/mono/StackExchange.Redis.dll
cp
StackExchange.Redis/bin/mono/
*
.
*
BasicTest/bin/mono/
...
...
monobuild.cmd
View file @
aab404ad
...
...
@@ -3,7 +3,7 @@
@md StackExchange.Redis\bin\mono 1>nul 2>nul
@md BasicTest\bin\mono 1>nul 2>nul
@echo Building StackExchange.Redis.dll ...
@call mcs -recurse:StackExchange.Redis\*.cs -out:StackExchange.Redis\bin\mono\StackExchange.Redis.dll -target:library -unsafe+ -o+ -r:System.IO.Compression.dll
-d:MONO
@call mcs -recurse:StackExchange.Redis\*.cs -out:StackExchange.Redis\bin\mono\StackExchange.Redis.dll -target:library -unsafe+ -o+ -r:System.IO.Compression.dll
@echo Building BasicTest.exe ...
@call mcs BasicTest\Program.cs -out:BasicTest\bin\mono\BasicTest.exe -target:exe -o+ -r:StackExchange.Redis\bin\mono\StackExchange.Redis.dll
@copy StackExchange.Redis\bin\mono\*.* BasicTest\bin\mono > nul
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment