Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
JAliEn
JAliEn-ROOT
Commits
fb9241fc
Commit
fb9241fc
authored
Oct 18, 2019
by
Volodymyr Yurchenko
Browse files
JAL-80
#comment Improve reading host and port from env
parent
c01c6803
Changes
2
Hide whitespace changes
Inline
Side-by-side
inc/TJAlienConnectionManager.h
View file @
fb9241fc
...
...
@@ -21,6 +21,7 @@ struct lws_context_creation_info;
#include
"TJAlienResult.h"
#include
"TJAlienCredentials.h"
#include
"TJAlienDNSResolver.h"
#include
"TJClientFile.h"
#include
"TError.h"
#include
"TGrid.h"
...
...
src/TJAlienConnectionManager.cxx
View file @
fb9241fc
...
...
@@ -101,30 +101,25 @@ void TJAlienConnectionManager::clearFlags()
//______________________________________________________________________________
void
TJAlienConnectionManager
::
ConnectJBox
(
TJAlienCredentialsObject
c
)
{
std
::
string
jboxHost
=
""
;
int
jboxPort
=
0
;
// Try to load host and port env vars
std
::
string
envHost
=
getenv
(
"JALIEN_HOST"
);
int
envPort
=
atoi
(
getenv
(
"JALIEN_WSPORT"
));
if
(
envHost
!=
NULL
&&
envHost
.
length
()
!=
0
&&
envPort
>
0
)
{
jboxHost
=
envHost
;
jboxPort
=
envPort
;
}
else
{
std
::
string
jboxHost
=
std
::
getenv
(
"JALIEN_HOST"
)
?
:
""
;
int
jboxPort
=
std
::
getenv
(
"JALIEN_WSPORT"
)
?
atoi
(
std
::
getenv
(
"JALIEN_WSPORT"
))
:
0
;
if
(
jboxHost
.
length
()
==
0
||
jboxPort
==
0
)
{
// Try to find jclient_token file
TJClientFile
jcf
;
if
(
jcf
.
isValid
)
{
jboxHost
=
(
std
::
string
)
jcf
.
fHost
;
jboxHost
=
(
std
::
string
)
jcf
.
fHost
;
jboxPort
=
jcf
.
fWSPort
;
}
else
if
(
gDebug
>=
1
)
Info
(
"TJAlienConnectionManager"
,
"The JClient file is not valid - not connecting to JBox!"
);
}
if
(
jboxHost
.
length
()
==
0
||
env
Port
==
0
)
{
if
(
jboxHost
.
length
()
==
0
||
jbox
Port
==
0
)
{
if
(
gDebug
>=
1
)
Info
(
"TJAlienConnectionManager"
,
"Failed to find any local JBox endpoint"
);
return
;
}
MakeWebsocketConnection
(
c
,
jboxHost
,
jboxPort
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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