Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
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
CAP
Commits
3c4629b5
Unverified
Commit
3c4629b5
authored
May 18, 2018
by
Lemon
Committed by
GitHub
May 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Device not configured (#47)
parent
035c6b2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
GrpcApplicationService.cs
src/SkyWalking.Core/Remote/GrpcApplicationService.cs
+22
-4
No files found.
src/SkyWalking.Core/Remote/GrpcApplicationService.cs
View file @
3c4629b5
...
@@ -17,8 +17,11 @@
...
@@ -17,8 +17,11 @@
*/
*/
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Diagnostics
;
using
System.Linq
;
using
System.Net
;
using
System.Net
;
using
System.Net.Sockets
;
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
SkyWalking.Boot
;
using
SkyWalking.Boot
;
...
@@ -122,10 +125,7 @@ namespace SkyWalking.Remote
...
@@ -122,10 +125,7 @@ namespace SkyWalking.Remote
ProcessNo
=
Process
.
GetCurrentProcess
().
Id
ProcessNo
=
Process
.
GetCurrentProcess
().
Id
};
};
// todo fix Device not configured
osInfo
.
Ipv4S
.
AddRange
(
GetIpV4S
(
hostName
));
//var ipv4s = Dns.GetHostAddresses(hostName);
//foreach (var ipAddress in ipv4s.Where(x => x.AddressFamily == AddressFamily.InterNetwork))
// osInfo.Ipv4S.Add(ipAddress.ToString());
var
applicationInstance
=
new
ApplicationInstance
var
applicationInstance
=
new
ApplicationInstance
{
{
...
@@ -161,5 +161,23 @@ namespace SkyWalking.Remote
...
@@ -161,5 +161,23 @@ namespace SkyWalking.Remote
}
}
}
}
}
}
private
IEnumerable
<
string
>
GetIpV4S
(
string
hostName
)
{
try
{
var
ipAddresses
=
Dns
.
GetHostAddresses
(
hostName
);
var
ipV4S
=
new
List
<
string
>();
foreach
(
var
ipAddress
in
ipAddresses
.
Where
(
x
=>
x
.
AddressFamily
==
AddressFamily
.
InterNetwork
))
ipV4S
.
Add
(
ipAddress
.
ToString
());
return
ipV4S
;
}
catch
(
Exception
e
)
{
_logger
.
Warning
(
$"Get host addresses fail.
{
e
.
Message
}
"
);
return
new
string
[
0
];
}
}
}
}
}
}
\ No newline at end of file
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