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
378b7ace
Commit
378b7ace
authored
Jan 29, 2015
by
olviko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A fix for
https://github.com/StackExchange/StackExchange.Redis/issues/20
parent
dcf546f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
SocketManager.cs
StackExchange.Redis/StackExchange/Redis/SocketManager.cs
+18
-4
No files found.
StackExchange.Redis/StackExchange/Redis/SocketManager.cs
View file @
378b7ace
...
...
@@ -120,6 +120,7 @@ public void Dispose()
}
OnDispose
();
}
internal
SocketToken
BeginConnect
(
EndPoint
endpoint
,
ISocketCallback
callback
)
{
var
socket
=
new
Socket
(
AddressFamily
.
InterNetwork
,
SocketType
.
Stream
,
ProtocolType
.
Tcp
);
...
...
@@ -130,10 +131,23 @@ internal SocketToken BeginConnect(EndPoint endpoint, ISocketCallback callback)
CompletionType
connectCompletionType
=
CompletionType
.
Any
;
this
.
ShouldForceConnectCompletionType
(
ref
connectCompletionType
);
CompletionTypeHelper
.
RunWithCompletionType
(
(
cb
)
=>
socket
.
BeginConnect
(
endpoint
,
cb
,
Tuple
.
Create
(
socket
,
callback
)),
(
ar
)
=>
EndConnectImpl
(
ar
),
connectCompletionType
);
if
(
endpoint
is
DnsEndPoint
)
{
// A work-around for a Mono bug in BeginConnect(EndPoint endpoint, AsyncCallback callback, object state)
DnsEndPoint
dnsEndpoint
=
(
DnsEndPoint
)
endpoint
;
CompletionTypeHelper
.
RunWithCompletionType
(
(
cb
)
=>
socket
.
BeginConnect
(
dnsEndpoint
.
Host
,
dnsEndpoint
.
Port
,
cb
,
Tuple
.
Create
(
socket
,
callback
)),
(
ar
)
=>
EndConnectImpl
(
ar
),
connectCompletionType
);
}
else
{
CompletionTypeHelper
.
RunWithCompletionType
(
(
cb
)
=>
socket
.
BeginConnect
(
endpoint
,
cb
,
Tuple
.
Create
(
socket
,
callback
)),
(
ar
)
=>
EndConnectImpl
(
ar
),
connectCompletionType
);
}
}
catch
(
NotImplementedException
ex
)
{
...
...
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