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
59e54f53
Commit
59e54f53
authored
Apr 23, 2014
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enabled SIO_LOOPBACK_FAST_PATH on win8/server2012 (via jepickett)
parent
d032d31a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
SocketManager.cs
StackExchange.Redis/StackExchange/Redis/SocketManager.cs
+20
-0
No files found.
StackExchange.Redis/StackExchange/Redis/SocketManager.cs
View file @
59e54f53
...
...
@@ -121,10 +121,30 @@ public void Dispose()
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
));
return
new
SocketToken
(
socket
);
}
internal
void
SetFastLoopbackOption
(
Socket
socket
)
{
// SIO_LOOPBACK_FAST_PATH (http://msdn.microsoft.com/en-us/library/windows/desktop/jj841212%28v=vs.85%29.aspx)
// Speeds up localhost operations significantly. OK to apply to a socket that will not be hooked up to localhost,
// or will be subject to WFP filtering.
const
int
SIO_LOOPBACK_FAST_PATH
=
-
1744830448
;
// windows only
if
(
Environment
.
OSVersion
.
Platform
==
PlatformID
.
Win32NT
)
{
// Win8/Server2012+ only
var
osVersion
=
Environment
.
OSVersion
.
Version
;
if
(
osVersion
.
Major
>
6
||
osVersion
.
Major
==
6
&&
osVersion
.
Minor
>=
2
)
{
byte
[]
optionInValue
=
BitConverter
.
GetBytes
(
1
);
socket
.
IOControl
(
SIO_LOOPBACK_FAST_PATH
,
optionInValue
,
null
);
}
}
}
internal
void
RequestWrite
(
PhysicalBridge
bridge
,
bool
forced
)
{
...
...
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