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
17e82256
Commit
17e82256
authored
Nov 04, 2015
by
Jeremy Meng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use DNXCORE50 constant instead of NETCORE. Socket is only supported on dnxcore.
parent
d694d922
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
45 additions
and
47 deletions
+45
-47
BasicOps.cs
StackExchange.Redis.Tests/BasicOps.cs
+5
-2
Cluster.cs
StackExchange.Redis.Tests/Cluster.cs
+1
-1
Config.cs
StackExchange.Redis.Tests/Config.cs
+1
-1
SO25567566.cs
StackExchange.Redis.Tests/Issues/SO25567566.cs
+1
-1
Naming.cs
StackExchange.Redis.Tests/Naming.cs
+4
-4
Profiling.cs
StackExchange.Redis.Tests/Profiling.cs
+1
-1
PubSub.cs
StackExchange.Redis.Tests/PubSub.cs
+1
-1
TestBase.cs
StackExchange.Redis.Tests/TestBase.cs
+1
-1
project.json
...is.Tests_dnxcore50/StackExchange.Redis.Tests/project.json
+0
-1
VolatileWrapper.cs
...hange.Redis/StackExchange/Redis/Compat/VolatileWrapper.cs
+2
-2
ConfigurationOptions.cs
...xchange.Redis/StackExchange/Redis/ConfigurationOptions.cs
+4
-4
ConnectionMultiplexer.cs
...change.Redis/StackExchange/Redis/ConnectionMultiplexer.cs
+10
-10
HashEntry.cs
StackExchange.Redis/StackExchange/Redis/HashEntry.cs
+1
-1
InternalRegexCompiledOption.cs
....Redis/StackExchange/Redis/InternalRegexCompiledOption.cs
+2
-2
RedisValue.cs
StackExchange.Redis/StackExchange/Redis/RedisValue.cs
+1
-1
ScriptParameterMapper.cs
...change.Redis/StackExchange/Redis/ScriptParameterMapper.cs
+3
-3
SocketManager.NoPoll.cs
...xchange.Redis/StackExchange/Redis/SocketManager.NoPoll.cs
+1
-1
SocketManager.Poll.cs
...kExchange.Redis/StackExchange/Redis/SocketManager.Poll.cs
+1
-5
SocketManager.cs
StackExchange.Redis/StackExchange/Redis/SocketManager.cs
+3
-3
SortedSetEntry.cs
StackExchange.Redis/StackExchange/Redis/SortedSetEntry.cs
+2
-2
No files found.
StackExchange.Redis.Tests/BasicOps.cs
View file @
17e82256
...
@@ -239,7 +239,7 @@ public void MassiveBulkOpsAsync(bool preserveOrder, bool withContinuation)
...
@@ -239,7 +239,7 @@ public void MassiveBulkOpsAsync(bool preserveOrder, bool withContinuation)
Action
<
Task
>
nonTrivial
=
delegate
Action
<
Task
>
nonTrivial
=
delegate
{
{
#if !
NETCORE
#if !
DNXCORE50
Thread
.
SpinWait
(
5
);
Thread
.
SpinWait
(
5
);
#else
#else
var
spinWait
=
new
SpinWait
();
var
spinWait
=
new
SpinWait
();
...
@@ -488,14 +488,17 @@ public void MassiveBulkOpsSyncOldStyle(ResultCompletionMode completionMode, int
...
@@ -488,14 +488,17 @@ public void MassiveBulkOpsSyncOldStyle(ResultCompletionMode completionMode, int
}
}
#endif
#endif
//TODO: Ignore("dnxcore crash")
#if !DNXCORE50
[
Test
]
[
Test
]
[
TestCase
(
true
,
1
)]
[
TestCase
(
true
,
1
)]
[
TestCase
(
false
,
1
)]
[
TestCase
(
false
,
1
)]
[
TestCase
(
true
,
5
)]
[
TestCase
(
true
,
5
)]
[
TestCase
(
false
,
5
)]
[
TestCase
(
false
,
5
)]
#endif
public
void
MassiveBulkOpsFireAndForget
(
bool
preserveOrder
,
int
threads
)
public
void
MassiveBulkOpsFireAndForget
(
bool
preserveOrder
,
int
threads
)
{
{
using
(
var
muxer
=
Create
())
using
(
var
muxer
=
Create
(
syncTimeout
:
20000
))
{
{
muxer
.
PreserveAsyncOrder
=
preserveOrder
;
muxer
.
PreserveAsyncOrder
=
preserveOrder
;
#if DEBUG
#if DEBUG
...
...
StackExchange.Redis.Tests/Cluster.cs
View file @
17e82256
...
@@ -20,7 +20,7 @@ public class Cluster : TestBase
...
@@ -20,7 +20,7 @@ public class Cluster : TestBase
protected
override
string
GetConfiguration
()
protected
override
string
GetConfiguration
()
{
{
var
server
=
ClusterIp
;
var
server
=
ClusterIp
;
#if !
NETCORE
#if !
DNXCORE50
if
(
string
.
Equals
(
Environment
.
MachineName
,
"MARC-LAPTOP"
,
StringComparison
.
InvariantCultureIgnoreCase
))
if
(
string
.
Equals
(
Environment
.
MachineName
,
"MARC-LAPTOP"
,
StringComparison
.
InvariantCultureIgnoreCase
))
#else
#else
if
(
string
.
Equals
(
Environment
.
GetEnvironmentVariable
(
"COMPUTERNAME"
),
"MARC-LAPTOP"
,
StringComparison
.
OrdinalIgnoreCase
))
if
(
string
.
Equals
(
Environment
.
GetEnvironmentVariable
(
"COMPUTERNAME"
),
"MARC-LAPTOP"
,
StringComparison
.
OrdinalIgnoreCase
))
...
...
StackExchange.Redis.Tests/Config.cs
View file @
17e82256
...
@@ -144,7 +144,7 @@ public void ReadConfig()
...
@@ -144,7 +144,7 @@ public void ReadConfig()
var
all
=
conn
.
ConfigGet
();
var
all
=
conn
.
ConfigGet
();
Assert
.
IsTrue
(
all
.
Length
>
0
,
"any"
);
Assert
.
IsTrue
(
all
.
Length
>
0
,
"any"
);
#if !
NETCORE
#if !
DNXCORE50
var
pairs
=
all
.
ToDictionary
(
x
=>
(
string
)
x
.
Key
,
x
=>
(
string
)
x
.
Value
,
StringComparer
.
InvariantCultureIgnoreCase
);
var
pairs
=
all
.
ToDictionary
(
x
=>
(
string
)
x
.
Key
,
x
=>
(
string
)
x
.
Value
,
StringComparer
.
InvariantCultureIgnoreCase
);
#else
#else
var
pairs
=
all
.
ToDictionary
(
x
=>
(
string
)
x
.
Key
,
x
=>
(
string
)
x
.
Value
,
StringComparer
.
OrdinalIgnoreCase
);
var
pairs
=
all
.
ToDictionary
(
x
=>
(
string
)
x
.
Key
,
x
=>
(
string
)
x
.
Value
,
StringComparer
.
OrdinalIgnoreCase
);
...
...
StackExchange.Redis.Tests/Issues/SO25567566.cs
View file @
17e82256
...
@@ -9,7 +9,7 @@ public class SO25567566 : TestBase
...
@@ -9,7 +9,7 @@ public class SO25567566 : TestBase
{
{
protected
override
string
GetConfiguration
()
protected
override
string
GetConfiguration
()
{
{
return
"127.0.0.1"
;
return
"127.0.0.1
:6379
"
;
}
}
[
Test
]
[
Test
]
public
async
void
Execute
()
public
async
void
Execute
()
...
...
StackExchange.Redis.Tests/Naming.cs
View file @
17e82256
...
@@ -150,7 +150,7 @@ public void CheckSyncAsyncMethodsMatch(Type from, Type to)
...
@@ -150,7 +150,7 @@ public void CheckSyncAsyncMethodsMatch(Type from, Type to)
var
pFrom
=
method
.
GetParameters
();
var
pFrom
=
method
.
GetParameters
();
Type
[]
args
=
pFrom
.
Select
(
x
=>
x
.
ParameterType
).
ToArray
();
Type
[]
args
=
pFrom
.
Select
(
x
=>
x
.
ParameterType
).
ToArray
();
Assert
.
AreEqual
(
typeof
(
CommandFlags
),
args
.
Last
());
Assert
.
AreEqual
(
typeof
(
CommandFlags
),
args
.
Last
());
#if !
NETCORE
#if !
DNXCORE50
var
found
=
to
.
GetMethod
(
huntName
,
flags
,
null
,
method
.
CallingConvention
,
args
,
null
);
var
found
=
to
.
GetMethod
(
huntName
,
flags
,
null
,
method
.
CallingConvention
,
args
,
null
);
#else
#else
var
found
=
to
.
GetMethods
(
flags
)
var
found
=
to
.
GetMethods
(
flags
)
...
@@ -176,14 +176,14 @@ void CheckMethod(MethodInfo method, bool isAsync)
...
@@ -176,14 +176,14 @@ void CheckMethod(MethodInfo method, bool isAsync)
{
{
#if DEBUG
#if DEBUG
#if !
NETCORE
#if !
DNXCORE50
bool
ignorePrefix
=
ignoreType
!=
null
&&
Attribute
.
IsDefined
(
method
,
ignoreType
);
bool
ignorePrefix
=
ignoreType
!=
null
&&
Attribute
.
IsDefined
(
method
,
ignoreType
);
#else
#else
bool
ignorePrefix
=
ignoreType
!=
null
&&
method
.
IsDefined
(
ignoreType
);
bool
ignorePrefix
=
ignoreType
!=
null
&&
method
.
IsDefined
(
ignoreType
);
#endif
#endif
if
(
ignorePrefix
)
if
(
ignorePrefix
)
{
{
#if !
NETCORE
#if !
DNXCORE50
Attribute
attrib
=
Attribute
.
GetCustomAttribute
(
method
,
ignoreType
);
Attribute
attrib
=
Attribute
.
GetCustomAttribute
(
method
,
ignoreType
);
#else
#else
Attribute
attrib
=
method
.
GetCustomAttribute
(
ignoreType
);
Attribute
attrib
=
method
.
GetCustomAttribute
(
ignoreType
);
...
@@ -228,7 +228,7 @@ void CheckName(MemberInfo member, bool isAsync)
...
@@ -228,7 +228,7 @@ void CheckName(MemberInfo member, bool isAsync)
public
static
class
ReflectionExtensions
public
static
class
ReflectionExtensions
{
{
#if !
NETCORE
#if !
DNXCORE50
public
static
Type
GetTypeInfo
(
this
Type
type
)
public
static
Type
GetTypeInfo
(
this
Type
type
)
{
{
return
type
;
return
type
;
...
...
StackExchange.Redis.Tests/Profiling.cs
View file @
17e82256
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
#if
NETCORE
#if
DNXCORE50
using
System.Reflection
;
using
System.Reflection
;
#endif
#endif
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
...
...
StackExchange.Redis.Tests/PubSub.cs
View file @
17e82256
...
@@ -417,7 +417,7 @@ internal static class VolatileWrapper
...
@@ -417,7 +417,7 @@ internal static class VolatileWrapper
{
{
public
static
int
Read
(
ref
int
location
)
public
static
int
Read
(
ref
int
location
)
{
{
#if !
NETCORE
#if !
DNXCORE50
return
Thread
.
VolatileRead
(
ref
location
);
return
Thread
.
VolatileRead
(
ref
location
);
#else
#else
return
Volatile
.
Read
(
ref
location
);
return
Volatile
.
Read
(
ref
location
);
...
...
StackExchange.Redis.Tests/TestBase.cs
View file @
17e82256
...
@@ -285,7 +285,7 @@ protected static TimeSpan RunConcurrent(Action work, int threads, int timeout =
...
@@ -285,7 +285,7 @@ protected static TimeSpan RunConcurrent(Action work, int threads, int timeout =
}
}
if
(!
allDone
.
WaitOne
(
timeout
))
if
(!
allDone
.
WaitOne
(
timeout
))
{
{
#if !
NETCORE
#if !
DNXCORE50
for
(
int
i
=
0
;
i
<
threads
;
i
++)
for
(
int
i
=
0
;
i
<
threads
;
i
++)
{
{
var
thd
=
threadArr
[
i
];
var
thd
=
threadArr
[
i
];
...
...
StackExchange.Redis.Tests_dnxcore50/StackExchange.Redis.Tests/project.json
View file @
17e82256
...
@@ -21,7 +21,6 @@
...
@@ -21,7 +21,6 @@
"frameworks"
:
{
"frameworks"
:
{
"dnxcore50"
:
{
"dnxcore50"
:
{
"compilationOptions"
:
{
"compilationOptions"
:
{
"define"
:
[
"NETCORE"
],
"warningsAsErrors"
:
false
"warningsAsErrors"
:
false
},
},
"dependencies"
:
{
"dependencies"
:
{
...
...
StackExchange.Redis/StackExchange/Redis/Compat/VolatileWrapper.cs
View file @
17e82256
...
@@ -10,7 +10,7 @@ internal static class VolatileWrapper
...
@@ -10,7 +10,7 @@ internal static class VolatileWrapper
{
{
public
static
int
Read
(
ref
int
location
)
public
static
int
Read
(
ref
int
location
)
{
{
#if !
NETCORE
#if !
DNXCORE50
return
System
.
Threading
.
Thread
.
VolatileRead
(
ref
location
);
return
System
.
Threading
.
Thread
.
VolatileRead
(
ref
location
);
#else
#else
return
System
.
Threading
.
Volatile
.
Read
(
ref
location
);
return
System
.
Threading
.
Volatile
.
Read
(
ref
location
);
...
@@ -19,7 +19,7 @@ public static int Read(ref int location)
...
@@ -19,7 +19,7 @@ public static int Read(ref int location)
public
static
void
Write
(
ref
int
address
,
int
value
)
public
static
void
Write
(
ref
int
address
,
int
value
)
{
{
#if !
NETCORE
#if !
DNXCORE50
System
.
Threading
.
Thread
.
VolatileWrite
(
ref
address
,
value
);
System
.
Threading
.
Thread
.
VolatileWrite
(
ref
address
,
value
);
#else
#else
System
.
Threading
.
Volatile
.
Write
(
ref
address
,
value
);
System
.
Threading
.
Volatile
.
Write
(
ref
address
,
value
);
...
...
StackExchange.Redis/StackExchange/Redis/ConfigurationOptions.cs
View file @
17e82256
...
@@ -30,7 +30,7 @@ public enum Proxy
...
@@ -30,7 +30,7 @@ public enum Proxy
/// The options relevant to a set of redis connections
/// The options relevant to a set of redis connections
/// </summary>
/// </summary>
public
sealed
class
ConfigurationOptions
public
sealed
class
ConfigurationOptions
#if !
NETCORE
#if !
DNXCORE50
:
ICloneable
:
ICloneable
#endif
#endif
{
{
...
@@ -143,7 +143,7 @@ public static string TryNormalize(string value)
...
@@ -143,7 +143,7 @@ public static string TryNormalize(string value)
/// Indicates whether the connection should be encrypted
/// Indicates whether the connection should be encrypted
/// </summary>
/// </summary>
[
Obsolete
(
"Please use .Ssl instead of .UseSsl"
),
[
Obsolete
(
"Please use .Ssl instead of .UseSsl"
),
#if !
NETCORE
#if !
DNXCORE50
Browsable
(
false
),
Browsable
(
false
),
#endif
#endif
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
...
@@ -470,7 +470,7 @@ static void Append(StringBuilder sb, string prefix, object value)
...
@@ -470,7 +470,7 @@ static void Append(StringBuilder sb, string prefix, object value)
}
}
}
}
#if !
NETCORE
#if !
DNXCORE50
static
bool
IsOption
(
string
option
,
string
prefix
)
static
bool
IsOption
(
string
option
,
string
prefix
)
{
{
return
option
.
StartsWith
(
prefix
,
StringComparison
.
InvariantCultureIgnoreCase
);
return
option
.
StartsWith
(
prefix
,
StringComparison
.
InvariantCultureIgnoreCase
);
...
@@ -492,7 +492,7 @@ void Clear()
...
@@ -492,7 +492,7 @@ void Clear()
SocketManager
=
null
;
SocketManager
=
null
;
}
}
#if !
NETCORE
#if !
DNXCORE50
object
ICloneable
.
Clone
()
{
return
Clone
();
}
object
ICloneable
.
Clone
()
{
return
Clone
();
}
#endif
#endif
...
...
StackExchange.Redis/StackExchange/Redis/ConnectionMultiplexer.cs
View file @
17e82256
...
@@ -561,7 +561,7 @@ private static bool WaitAllIgnoreErrors(Task[] tasks, int timeout)
...
@@ -561,7 +561,7 @@ private static bool WaitAllIgnoreErrors(Task[] tasks, int timeout)
return
false
;
return
false
;
}
}
#if !
NETCORE
#if !
DNXCORE50
private
void
LogLockedWithThreadPoolStats
(
TextWriter
log
,
string
message
,
out
int
busyWorkerCount
)
private
void
LogLockedWithThreadPoolStats
(
TextWriter
log
,
string
message
,
out
int
busyWorkerCount
)
{
{
busyWorkerCount
=
0
;
busyWorkerCount
=
0
;
...
@@ -603,7 +603,7 @@ private async Task<bool> WaitAllIgnoreErrorsAsync(Task[] tasks, int timeoutMilli
...
@@ -603,7 +603,7 @@ private async Task<bool> WaitAllIgnoreErrorsAsync(Task[] tasks, int timeoutMilli
}
}
var
watch
=
Stopwatch
.
StartNew
();
var
watch
=
Stopwatch
.
StartNew
();
#if !
NETCORE
#if !
DNXCORE50
int
busyWorkerCount
;
int
busyWorkerCount
;
LogLockedWithThreadPoolStats
(
log
,
"Awaiting task completion"
,
out
busyWorkerCount
);
LogLockedWithThreadPoolStats
(
log
,
"Awaiting task completion"
,
out
busyWorkerCount
);
#endif
#endif
...
@@ -613,7 +613,7 @@ private async Task<bool> WaitAllIgnoreErrorsAsync(Task[] tasks, int timeoutMilli
...
@@ -613,7 +613,7 @@ private async Task<bool> WaitAllIgnoreErrorsAsync(Task[] tasks, int timeoutMilli
var
remaining
=
timeoutMilliseconds
-
checked
((
int
)
watch
.
ElapsedMilliseconds
);
var
remaining
=
timeoutMilliseconds
-
checked
((
int
)
watch
.
ElapsedMilliseconds
);
if
(
remaining
<=
0
)
if
(
remaining
<=
0
)
{
{
#if !
NETCORE
#if !
DNXCORE50
LogLockedWithThreadPoolStats
(
log
,
"Timeout before awaiting for tasks"
,
out
busyWorkerCount
);
LogLockedWithThreadPoolStats
(
log
,
"Timeout before awaiting for tasks"
,
out
busyWorkerCount
);
#endif
#endif
return
false
;
return
false
;
...
@@ -627,7 +627,7 @@ private async Task<bool> WaitAllIgnoreErrorsAsync(Task[] tasks, int timeoutMilli
...
@@ -627,7 +627,7 @@ private async Task<bool> WaitAllIgnoreErrorsAsync(Task[] tasks, int timeoutMilli
var
any
=
Task
.
WhenAny
(
allTasks
,
Task
.
Delay
(
remaining
)).
ObserveErrors
();
var
any
=
Task
.
WhenAny
(
allTasks
,
Task
.
Delay
(
remaining
)).
ObserveErrors
();
#endif
#endif
bool
all
=
await
any
.
ForAwait
()
==
allTasks
;
bool
all
=
await
any
.
ForAwait
()
==
allTasks
;
#if !
NETCORE
#if !
DNXCORE50
LogLockedWithThreadPoolStats
(
log
,
all
?
"All tasks completed cleanly"
:
"Not all tasks completed cleanly"
,
out
busyWorkerCount
);
LogLockedWithThreadPoolStats
(
log
,
all
?
"All tasks completed cleanly"
:
"Not all tasks completed cleanly"
,
out
busyWorkerCount
);
#endif
#endif
return
all
;
return
all
;
...
@@ -645,7 +645,7 @@ private async Task<bool> WaitAllIgnoreErrorsAsync(Task[] tasks, int timeoutMilli
...
@@ -645,7 +645,7 @@ private async Task<bool> WaitAllIgnoreErrorsAsync(Task[] tasks, int timeoutMilli
var
remaining
=
timeoutMilliseconds
-
checked
((
int
)
watch
.
ElapsedMilliseconds
);
var
remaining
=
timeoutMilliseconds
-
checked
((
int
)
watch
.
ElapsedMilliseconds
);
if
(
remaining
<=
0
)
if
(
remaining
<=
0
)
{
{
#if !
NETCORE
#if !
DNXCORE50
LogLockedWithThreadPoolStats
(
log
,
"Timeout awaiting tasks"
,
out
busyWorkerCount
);
LogLockedWithThreadPoolStats
(
log
,
"Timeout awaiting tasks"
,
out
busyWorkerCount
);
#endif
#endif
return
false
;
return
false
;
...
@@ -663,7 +663,7 @@ private async Task<bool> WaitAllIgnoreErrorsAsync(Task[] tasks, int timeoutMilli
...
@@ -663,7 +663,7 @@ private async Task<bool> WaitAllIgnoreErrorsAsync(Task[] tasks, int timeoutMilli
{
}
{
}
}
}
}
}
#if !
NETCORE
#if !
DNXCORE50
LogLockedWithThreadPoolStats
(
log
,
"Finished awaiting tasks"
,
out
busyWorkerCount
);
LogLockedWithThreadPoolStats
(
log
,
"Finished awaiting tasks"
,
out
busyWorkerCount
);
#endif
#endif
return
false
;
return
false
;
...
@@ -1887,7 +1887,7 @@ internal T ExecuteSyncImpl<T>(Message message, ResultProcessor<T> processor, Ser
...
@@ -1887,7 +1887,7 @@ internal T ExecuteSyncImpl<T>(Message message, ResultProcessor<T> processor, Ser
else
else
{
{
int
inst
,
qu
,
qs
,
qc
,
wr
,
wq
,
@in
,
ar
;
int
inst
,
qu
,
qs
,
qc
,
wr
,
wq
,
@in
,
ar
;
#if !__MonoCS__ && !
NETCORE
#if !__MonoCS__ && !
DNXCORE50
var
mgrState
=
socketManager
.
State
;
var
mgrState
=
socketManager
.
State
;
var
lastError
=
socketManager
.
LastErrorTimeRelative
();
var
lastError
=
socketManager
.
LastErrorTimeRelative
();
...
@@ -1902,7 +1902,7 @@ internal T ExecuteSyncImpl<T>(Message message, ResultProcessor<T> processor, Ser
...
@@ -1902,7 +1902,7 @@ internal T ExecuteSyncImpl<T>(Message message, ResultProcessor<T> processor, Ser
int
queue
=
server
.
GetOutstandingCount
(
message
.
Command
,
out
inst
,
out
qu
,
out
qs
,
out
qc
,
out
wr
,
out
wq
,
out
@in
,
out
ar
);
int
queue
=
server
.
GetOutstandingCount
(
message
.
Command
,
out
inst
,
out
qu
,
out
qs
,
out
qc
,
out
wr
,
out
wq
,
out
@in
,
out
ar
);
add
(
"Instantaneous"
,
"inst"
,
inst
.
ToString
());
add
(
"Instantaneous"
,
"inst"
,
inst
.
ToString
());
#if !__MonoCS__ && !
NETCORE
#if !__MonoCS__ && !
DNXCORE50
add
(
"Manager-State"
,
"mgr"
,
mgrState
.
ToString
());
add
(
"Manager-State"
,
"mgr"
,
mgrState
.
ToString
());
add
(
"Last-Error"
,
"err"
,
lastError
);
add
(
"Last-Error"
,
"err"
,
lastError
);
#endif
#endif
...
@@ -1916,7 +1916,7 @@ internal T ExecuteSyncImpl<T>(Message message, ResultProcessor<T> processor, Ser
...
@@ -1916,7 +1916,7 @@ internal T ExecuteSyncImpl<T>(Message message, ResultProcessor<T> processor, Ser
add
(
"Active-Readers"
,
"ar"
,
ar
.
ToString
());
add
(
"Active-Readers"
,
"ar"
,
ar
.
ToString
());
add
(
"Client-Name"
,
"clientName"
,
ClientName
);
add
(
"Client-Name"
,
"clientName"
,
ClientName
);
#if !
NETCORE
#if !
DNXCORE50
string
iocp
,
worker
;
string
iocp
,
worker
;
int
busyWorkerCount
=
GetThreadPoolStats
(
out
iocp
,
out
worker
);
int
busyWorkerCount
=
GetThreadPoolStats
(
out
iocp
,
out
worker
);
add
(
"ThreadPool-IO-Completion"
,
"IOCP"
,
iocp
);
add
(
"ThreadPool-IO-Completion"
,
"IOCP"
,
iocp
);
...
@@ -1953,7 +1953,7 @@ internal T ExecuteSyncImpl<T>(Message message, ResultProcessor<T> processor, Ser
...
@@ -1953,7 +1953,7 @@ internal T ExecuteSyncImpl<T>(Message message, ResultProcessor<T> processor, Ser
}
}
}
}
#if !
NETCORE
#if !
DNXCORE50
private
static
int
GetThreadPoolStats
(
out
string
iocp
,
out
string
worker
)
private
static
int
GetThreadPoolStats
(
out
string
iocp
,
out
string
worker
)
{
{
//BusyThreads = TP.GetMaxThreads() –TP.GetAVailable();
//BusyThreads = TP.GetMaxThreads() –TP.GetAVailable();
...
...
StackExchange.Redis/StackExchange/Redis/HashEntry.cs
View file @
17e82256
...
@@ -32,7 +32,7 @@ public HashEntry(RedisValue name, RedisValue value)
...
@@ -32,7 +32,7 @@ public HashEntry(RedisValue name, RedisValue value)
/// The name of the hash field
/// The name of the hash field
/// </summary>
/// </summary>
[
[
#if !
NETCORE
#if !
DNXCORE50
Browsable
(
false
),
Browsable
(
false
),
#endif
#endif
EditorBrowsable
(
EditorBrowsableState
.
Never
),
Obsolete
(
"Please use Name"
,
false
)]
EditorBrowsable
(
EditorBrowsableState
.
Never
),
Obsolete
(
"Please use Name"
,
false
)]
...
...
StackExchange.Redis/StackExchange/Redis/InternalRegexCompiledOption.cs
View file @
17e82256
#
if
NETCORE
#
if
DNXCORE50
using
System
;
using
System
;
#endif
#endif
using
System.Text.RegularExpressions
;
using
System.Text.RegularExpressions
;
...
@@ -11,7 +11,7 @@ internal static class InternalRegexCompiledOption
...
@@ -11,7 +11,7 @@ internal static class InternalRegexCompiledOption
static
InternalRegexCompiledOption
()
static
InternalRegexCompiledOption
()
{
{
#if
NETCORE
#if
DNXCORE50
if
(!
Enum
.
TryParse
(
"Compiled"
,
out
RegexCompiledOption
))
if
(!
Enum
.
TryParse
(
"Compiled"
,
out
RegexCompiledOption
))
RegexCompiledOption
=
RegexOptions
.
None
;
RegexCompiledOption
=
RegexOptions
.
None
;
#else
#else
...
...
StackExchange.Redis/StackExchange/Redis/RedisValue.cs
View file @
17e82256
...
@@ -306,7 +306,7 @@ public int CompareTo(RedisValue other)
...
@@ -306,7 +306,7 @@ public int CompareTo(RedisValue other)
if
(
otherType
==
CompareType
.
Double
)
return
thisDouble
.
CompareTo
(
otherDouble
);
if
(
otherType
==
CompareType
.
Double
)
return
thisDouble
.
CompareTo
(
otherDouble
);
}
}
// otherwise, compare as strings
// otherwise, compare as strings
#if !
NETCORE
#if !
DNXCORE50
return
StringComparer
.
InvariantCulture
.
Compare
((
string
)
this
,
(
string
)
other
);
return
StringComparer
.
InvariantCulture
.
Compare
((
string
)
this
,
(
string
)
other
);
#else
#else
var
compareInfo
=
System
.
Globalization
.
CultureInfo
.
InvariantCulture
.
CompareInfo
;
var
compareInfo
=
System
.
Globalization
.
CultureInfo
.
InvariantCulture
.
CompareInfo
;
...
...
StackExchange.Redis/StackExchange/Redis/ScriptParameterMapper.cs
View file @
17e82256
...
@@ -313,7 +313,7 @@ static void PrefixIfNeeded(ILGenerator il, LocalBuilder needsPrefixBool, ref Loc
...
@@ -313,7 +313,7 @@ static void PrefixIfNeeded(ILGenerator il, LocalBuilder needsPrefixBool, ref Loc
LocalBuilder
redisKeyLoc
=
null
;
LocalBuilder
redisKeyLoc
=
null
;
var
loc
=
il
.
DeclareLocal
(
t
);
var
loc
=
il
.
DeclareLocal
(
t
);
il
.
Emit
(
OpCodes
.
Ldarg_0
);
// object
il
.
Emit
(
OpCodes
.
Ldarg_0
);
// object
#if !
NETCORE
#if !
DNXCORE50
if
(
t
.
IsValueType
)
if
(
t
.
IsValueType
)
#else
#else
if
(
t
.
GetTypeInfo
().
IsValueType
)
if
(
t
.
GetTypeInfo
().
IsValueType
)
...
@@ -348,7 +348,7 @@ static void PrefixIfNeeded(ILGenerator il, LocalBuilder needsPrefixBool, ref Loc
...
@@ -348,7 +348,7 @@ static void PrefixIfNeeded(ILGenerator il, LocalBuilder needsPrefixBool, ref Loc
{
{
il
.
Emit
(
OpCodes
.
Dup
);
// RedisKey[] RedisKey[]
il
.
Emit
(
OpCodes
.
Dup
);
// RedisKey[] RedisKey[]
il
.
Emit
(
OpCodes
.
Ldc_I4
,
i
);
// RedisKey[] RedisKey[] int
il
.
Emit
(
OpCodes
.
Ldc_I4
,
i
);
// RedisKey[] RedisKey[] int
#if !
NETCORE
#if !
DNXCORE50
if
(
t
.
IsValueType
)
if
(
t
.
IsValueType
)
#else
#else
if
(
t
.
GetTypeInfo
().
IsValueType
)
if
(
t
.
GetTypeInfo
().
IsValueType
)
...
@@ -380,7 +380,7 @@ static void PrefixIfNeeded(ILGenerator il, LocalBuilder needsPrefixBool, ref Loc
...
@@ -380,7 +380,7 @@ static void PrefixIfNeeded(ILGenerator il, LocalBuilder needsPrefixBool, ref Loc
{
{
il
.
Emit
(
OpCodes
.
Dup
);
// RedisKey[] RedisValue[] RedisValue[]
il
.
Emit
(
OpCodes
.
Dup
);
// RedisKey[] RedisValue[] RedisValue[]
il
.
Emit
(
OpCodes
.
Ldc_I4
,
i
);
// RedisKey[] RedisValue[] RedisValue[] int
il
.
Emit
(
OpCodes
.
Ldc_I4
,
i
);
// RedisKey[] RedisValue[] RedisValue[] int
#if !
NETCORE
#if !
DNXCORE50
if
(
t
.
IsValueType
)
if
(
t
.
IsValueType
)
#else
#else
if
(
t
.
GetTypeInfo
().
IsValueType
)
if
(
t
.
GetTypeInfo
().
IsValueType
)
...
...
StackExchange.Redis/StackExchange/Redis/SocketManager.NoPoll.cs
View file @
17e82256
#
if
__MonoCS__
||
NETCORE
#
if
__MonoCS__
||
DNXCORE50
namespace
StackExchange.Redis
namespace
StackExchange.Redis
{
{
...
...
StackExchange.Redis/StackExchange/Redis/SocketManager.Poll.cs
View file @
17e82256
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
using
System.Runtime.InteropServices
;
using
System.Runtime.InteropServices
;
using
System.Threading
;
using
System.Threading
;
#if !__MonoCS__ && !
NETCORE
#if !__MonoCS__ && !
DNXCORE50
namespace
StackExchange.Redis
namespace
StackExchange.Redis
{
{
...
@@ -376,12 +376,8 @@ private void ReadImpl()
...
@@ -376,12 +376,8 @@ private void ReadImpl()
private
void
StartReader
()
private
void
StartReader
()
{
{
#if !NETCORE
var
thread
=
new
Thread
(
read
,
32
*
1024
);
// don't need a huge stack
var
thread
=
new
Thread
(
read
,
32
*
1024
);
// don't need a huge stack
thread
.
Priority
=
ThreadPriority
.
AboveNormal
;
// time critical
thread
.
Priority
=
ThreadPriority
.
AboveNormal
;
// time critical
#else
var
thread
=
new
Thread
(
read
);
// don't need a huge stack
#endif
thread
.
Name
=
name
+
":Read"
;
thread
.
Name
=
name
+
":Read"
;
thread
.
IsBackground
=
true
;
thread
.
IsBackground
=
true
;
thread
.
Start
(
this
);
thread
.
Start
(
this
);
...
...
StackExchange.Redis/StackExchange/Redis/SocketManager.cs
View file @
17e82256
...
@@ -126,7 +126,7 @@ public SocketManager(string name = null)
...
@@ -126,7 +126,7 @@ public SocketManager(string name = null)
// we need a dedicated writer, because when under heavy ambient load
// we need a dedicated writer, because when under heavy ambient load
// (a busy asp.net site, for example), workers are not reliable enough
// (a busy asp.net site, for example), workers are not reliable enough
#if !
NETCORE
#if !
DNXCORE50
Thread
dedicatedWriter
=
new
Thread
(
writeAllQueues
,
32
*
1024
);
// don't need a huge stack;
Thread
dedicatedWriter
=
new
Thread
(
writeAllQueues
,
32
*
1024
);
// don't need a huge stack;
dedicatedWriter
.
Priority
=
ThreadPriority
.
AboveNormal
;
// time critical
dedicatedWriter
.
Priority
=
ThreadPriority
.
AboveNormal
;
// time critical
#else
#else
...
@@ -221,7 +221,7 @@ internal void SetFastLoopbackOption(Socket socket)
...
@@ -221,7 +221,7 @@ internal void SetFastLoopbackOption(Socket socket)
// SIO_LOOPBACK_FAST_PATH (http://msdn.microsoft.com/en-us/library/windows/desktop/jj841212%28v=vs.85%29.aspx)
// 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,
// 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.
// or will be subject to WFP filtering.
#if !
NETCORE
#if !
DNXCORE50
const
int
SIO_LOOPBACK_FAST_PATH
=
-
1744830448
;
const
int
SIO_LOOPBACK_FAST_PATH
=
-
1744830448
;
// windows only
// windows only
...
@@ -340,7 +340,7 @@ private void Shutdown(Socket socket)
...
@@ -340,7 +340,7 @@ private void Shutdown(Socket socket)
{
{
OnShutdown
(
socket
);
OnShutdown
(
socket
);
try
{
socket
.
Shutdown
(
SocketShutdown
.
Both
);
}
catch
{
}
try
{
socket
.
Shutdown
(
SocketShutdown
.
Both
);
}
catch
{
}
#if !
NETCORE
#if !
DNXCORE50
try
{
socket
.
Close
();
}
catch
{
}
try
{
socket
.
Close
();
}
catch
{
}
#endif
#endif
try
{
socket
.
Dispose
();
}
catch
{
}
try
{
socket
.
Dispose
();
}
catch
{
}
...
...
StackExchange.Redis/StackExchange/Redis/SortedSetEntry.cs
View file @
17e82256
...
@@ -33,7 +33,7 @@ public SortedSetEntry(RedisValue element, double score)
...
@@ -33,7 +33,7 @@ public SortedSetEntry(RedisValue element, double score)
/// The score against the element
/// The score against the element
/// </summary>
/// </summary>
[
[
#if !
NETCORE
#if !
DNXCORE50
Browsable
(
false
),
Browsable
(
false
),
#endif
#endif
EditorBrowsable
(
EditorBrowsableState
.
Never
),
Obsolete
(
"Please use Score"
,
false
)]
EditorBrowsable
(
EditorBrowsableState
.
Never
),
Obsolete
(
"Please use Score"
,
false
)]
...
@@ -43,7 +43,7 @@ public SortedSetEntry(RedisValue element, double score)
...
@@ -43,7 +43,7 @@ public SortedSetEntry(RedisValue element, double score)
/// The unique element stored in the sorted set
/// The unique element stored in the sorted set
/// </summary>
/// </summary>
[
[
#if !
NETCORE
#if !
DNXCORE50
Browsable
(
false
),
Browsable
(
false
),
#endif
#endif
EditorBrowsable
(
EditorBrowsableState
.
Never
),
Obsolete
(
"Please use Element"
,
false
)]
EditorBrowsable
(
EditorBrowsableState
.
Never
),
Obsolete
(
"Please use Element"
,
false
)]
...
...
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