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
2855c627
Commit
2855c627
authored
Mar 11, 2018
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: ClientInfo
parent
40ed8d7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
22 deletions
+9
-22
ClientInfo.cs
StackExchange.Redis/StackExchange/Redis/ClientInfo.cs
+9
-22
No files found.
StackExchange.Redis/StackExchange/Redis/ClientInfo.cs
View file @
2855c627
...
...
@@ -50,15 +50,7 @@ public sealed class ClientInfo
/// <summary>
/// The host of the client (typically an IP address)
/// </summary>
public
string
Host
{
get
{
string
host
;
int
port
;
return
Format
.
TryGetHostPort
(
Address
,
out
host
,
out
port
)
?
host
:
null
;
}
}
public
string
Host
=>
Format
.
TryGetHostPort
(
Address
,
out
string
host
,
out
_
)
?
host
:
null
;
/// <summary>
/// idle time of the connection in seconds
...
...
@@ -83,15 +75,8 @@ public string Host
/// <summary>
/// The port of the client
/// </summary>
public
int
Port
{
get
{
string
host
;
int
port
;
return
Format
.
TryGetHostPort
(
Address
,
out
host
,
out
port
)
?
port
:
0
;
}
}
public
int
Port
=>
Format
.
TryGetHostPort
(
Address
,
out
_
,
out
int
port
)
?
port
:
0
;
/// <summary>
/// The raw content from redis
/// </summary>
...
...
@@ -130,7 +115,7 @@ public ClientType ClientType
{
if
(
SubscriptionCount
!=
0
||
PatternSubscriptionCount
!=
0
)
return
ClientType
.
PubSub
;
if
((
Flags
&
ClientFlags
.
Slave
)
!=
0
)
return
ClientType
.
Slave
;
return
ClientType
.
Normal
;
return
ClientType
.
Normal
;
}
}
...
...
@@ -144,8 +129,10 @@ internal static ClientInfo[] Parse(string input)
string
line
;
while
((
line
=
reader
.
ReadLine
())
!=
null
)
{
var
client
=
new
ClientInfo
();
client
.
Raw
=
line
;
var
client
=
new
ClientInfo
{
Raw
=
line
};
string
[]
tokens
=
line
.
Split
(
StringSplits
.
Space
);
for
(
int
i
=
0
;
i
<
tokens
.
Length
;
i
++)
{
...
...
@@ -189,7 +176,7 @@ internal static ClientInfo[] Parse(string input)
return
clients
.
ToArray
();
}
static
void
AddFlag
(
ref
ClientFlags
value
,
string
raw
,
ClientFlags
toAdd
,
char
token
)
private
static
void
AddFlag
(
ref
ClientFlags
value
,
string
raw
,
ClientFlags
toAdd
,
char
token
)
{
if
(
raw
.
IndexOf
(
token
)
>=
0
)
value
|=
toAdd
;
}
...
...
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