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
d5fff16f
Commit
d5fff16f
authored
Mar 21, 2018
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: ServerEndpoint
parent
170bbca5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
ServerEndPoint.cs
StackExchange.Redis/StackExchange/Redis/ServerEndPoint.cs
+10
-9
No files found.
StackExchange.Redis/StackExchange/Redis/ServerEndPoint.cs
View file @
d5fff16f
...
...
@@ -78,7 +78,7 @@ public ServerEndPoint(ConnectionMultiplexer multiplexer, EndPoint endpoint, Text
public
bool
IsConnected
=>
interactive
?.
IsConnected
==
true
;
public
bool
IsConnecting
=>
interactive
?.
IsConnecting
==
true
;
internal
Exception
LastException
{
get
...
...
@@ -321,7 +321,7 @@ internal void AutoConfigure(PhysicalConnection connection)
private
int
_nextReplicaOffset
;
internal
uint
NextReplicaOffset
()
// used to round-robin between multiple replicas
=>
(
uint
)
System
.
Threading
.
Interlocked
.
Increment
(
ref
_nextReplicaOffset
);
=>
(
uint
)
System
.
Threading
.
Interlocked
.
Increment
(
ref
_nextReplicaOffset
);
internal
Task
Close
()
{
...
...
@@ -393,11 +393,11 @@ internal string GetProfile()
internal
byte
[]
GetScriptHash
(
string
script
,
RedisCommand
command
)
{
var
found
=
(
byte
[])
knownScripts
[
script
];
if
(
found
==
null
&&
command
==
RedisCommand
.
EVALSHA
)
if
(
found
==
null
&&
command
==
RedisCommand
.
EVALSHA
)
{
// the script provided is a hex sha; store and re-use the ascii for that
found
=
Encoding
.
ASCII
.
GetBytes
(
script
);
lock
(
knownScripts
)
lock
(
knownScripts
)
{
knownScripts
[
script
]
=
found
;
}
...
...
@@ -581,14 +581,15 @@ internal string Summary()
var
tmp
=
interactive
;
sb
.
Append
(
"; int: "
).
Append
(
tmp
?.
ConnectionState
.
ToString
()
??
"n/a"
);
tmp
=
subscription
;
if
(
tmp
==
null
)
if
(
tmp
==
null
)
{
sb
.
Append
(
"; sub: n/a"
);
}
else
}
else
{
var
state
=
tmp
.
ConnectionState
;
sb
.
Append
(
"; sub: "
).
Append
(
state
);
if
(
state
==
PhysicalBridge
.
State
.
ConnectedEstablished
)
if
(
state
==
PhysicalBridge
.
State
.
ConnectedEstablished
)
{
sb
.
Append
(
", "
).
Append
(
tmp
.
SubscriptionCount
).
Append
(
" active"
);
}
...
...
@@ -678,7 +679,7 @@ private void Handshake(PhysicalConnection connection, TextWriter log)
if
(
connType
==
ConnectionType
.
Subscription
)
{
var
configChannel
=
multiplexer
.
ConfigurationChangedChannel
;
if
(
configChannel
!=
null
)
if
(
configChannel
!=
null
)
{
msg
=
Message
.
Create
(-
1
,
CommandFlags
.
FireAndForget
,
RedisCommand
.
SUBSCRIBE
,
(
RedisChannel
)
configChannel
);
WriteDirectOrQueueFireAndForget
(
connection
,
msg
,
ResultProcessor
.
TrackSubscriptions
);
...
...
@@ -690,7 +691,7 @@ private void Handshake(PhysicalConnection connection, TextWriter log)
private
void
SetConfig
<
T
>(
ref
T
field
,
T
value
,
[
CallerMemberName
]
string
caller
=
null
)
{
if
(!
EqualityComparer
<
T
>.
Default
.
Equals
(
field
,
value
))
if
(!
EqualityComparer
<
T
>.
Default
.
Equals
(
field
,
value
))
{
multiplexer
.
Trace
(
caller
+
" changed from "
+
field
+
" to "
+
value
,
"Configuration"
);
field
=
value
;
...
...
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