Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Shervin Nourbakhsh
cameo
Commits
15ba286c
Commit
15ba286c
authored
Apr 07, 2020
by
legoc
Browse files
Refined endpoint definition: if hostname is not available, try the IP address
parent
80ea3bf1
Changes
2
Hide whitespace changes
Inline
Side-by-side
cameo-server-jzmq/pom.xml
View file @
15ba286c
...
...
@@ -13,7 +13,7 @@
<dependency>
<groupId>
fr.ill.ics
</groupId>
<artifactId>
cameo-server
</artifactId>
<version>
0.1.
5
</version>
<version>
0.1.
6
</version>
<exclusions>
<exclusion>
<groupId>
fr.ill.ics
</groupId>
...
...
cameo-server/src/main/java/fr/ill/ics/cameo/manager/ConfigManager.java
View file @
15ba286c
...
...
@@ -162,11 +162,19 @@ public final class ConfigManager {
}
public
void
setHost
(
String
host
)
{
// If host is provided, set it.
if
(
host
==
null
)
{
try
{
// Otherwise try to get the hostname.
this
.
host
=
InetAddress
.
getLocalHost
().
getHostName
();
}
catch
(
UnknownHostException
e
)
{
this
.
host
=
"localhost"
;
try
{
// Otherwise try to get the IP address.
this
.
host
=
InetAddress
.
getLocalHost
().
getHostAddress
();
}
catch
(
UnknownHostException
e2
)
{
// Otherwise set localhost.
this
.
host
=
"localhost"
;
}
}
}
else
{
this
.
host
=
host
;
...
...
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