Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
c92a102b
Commit
c92a102b
authored
Jun 02, 2015
by
Salvador Fandino
Committed by
Mike Gabriel
Jul 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewrite WaitForRemote to build on top of ListenConnectionTCP
parent
28736a88
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
61 deletions
+2
-61
Loop.cpp
nxcomp/Loop.cpp
+2
-61
No files found.
nxcomp/Loop.cpp
View file @
c92a102b
...
...
@@ -6611,7 +6611,6 @@ int WaitForRemote(int portNum)
char
hostLabel
[
DEFAULT_STRING_LENGTH
]
=
{
0
};
int
retryAccept
=
-
1
;
int
listenIPAddr
=
-
1
;
int
proxyFD
=
-
1
;
int
newFD
=
-
1
;
...
...
@@ -6640,66 +6639,8 @@ int WaitForRemote(int portNum)
}
}
proxyFD
=
socket
(
AF_INET
,
SOCK_STREAM
,
PF_UNSPEC
);
if
(
proxyFD
==
-
1
)
{
#ifdef PANIC
*
logofs
<<
"Loop: PANIC! Call to socket failed for TCP socket. "
<<
"Error is "
<<
EGET
()
<<
" '"
<<
ESTR
()
<<
"'.
\n
"
<<
logofs_flush
;
#endif
cerr
<<
"Error"
<<
": Call to socket failed for TCP socket. "
<<
"Error is "
<<
EGET
()
<<
" '"
<<
ESTR
()
<<
"'.
\n
"
;
goto
WaitForRemoteError
;
}
else
if
(
SetReuseAddress
(
proxyFD
)
<
0
)
{
goto
WaitForRemoteError
;
}
listenIPAddr
=
0
;
ParseListenOption
(
listenIPAddr
);
sockaddr_in
tcpAddr
;
tcpAddr
.
sin_family
=
AF_INET
;
tcpAddr
.
sin_port
=
htons
(
portNum
);
tcpAddr
.
sin_addr
.
s_addr
=
listenIPAddr
;
if
(
bind
(
proxyFD
,
(
sockaddr
*
)
&
tcpAddr
,
sizeof
(
tcpAddr
))
==
-
1
)
{
#ifdef PANIC
*
logofs
<<
"Loop: PANIC! Call to bind failed for TCP port "
<<
portNum
<<
". Error is "
<<
EGET
()
<<
" '"
<<
ESTR
()
<<
"'.
\n
"
<<
logofs_flush
;
#endif
cerr
<<
"Error"
<<
": Call to bind failed for TCP port "
<<
portNum
<<
". Error is "
<<
EGET
()
<<
" '"
<<
ESTR
()
<<
"'.
\n
"
;
goto
WaitForRemoteError
;
}
if
(
listen
(
proxyFD
,
4
)
==
-
1
)
{
#ifdef PANIC
*
logofs
<<
"Loop: PANIC! Call to listen failed for TCP port "
<<
portNum
<<
". Error is "
<<
EGET
()
<<
" '"
<<
ESTR
()
<<
"'.
\n
"
<<
logofs_flush
;
#endif
cerr
<<
"Error"
<<
": Call to listen failed for TCP port "
<<
portNum
<<
". Error is "
<<
EGET
()
<<
" '"
<<
ESTR
()
<<
"'.
\n
"
;
goto
WaitForRemoteError
;
}
proxyFD
=
ListenConnectionTCP
(
((
loopbackBind
||
(
control
->
ProxyMode
==
proxy_server
))
?
"localhost"
:
"*"
),
portNum
,
"NX"
);
if
(
*
acceptHost
!=
'\0'
)
{
...
...
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