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
c5a2cf82
Commit
c5a2cf82
authored
Jun 01, 2015
by
Salvador Fandino
Committed by
Mike Gabriel
Jul 04, 2016
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework SetupTcpSocket to use ListenConnectionTCP
parent
e0edae04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
66 deletions
+1
-66
Loop.cpp
nxcomp/Loop.cpp
+1
-66
No files found.
nxcomp/Loop.cpp
View file @
c5a2cf82
...
...
@@ -3945,72 +3945,7 @@ int SetupTcpSocket()
// Open TCP socket emulating local display.
//
tcpFD
=
socket
(
AF_INET
,
SOCK_STREAM
,
PF_UNSPEC
);
if
(
tcpFD
==
-
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
"
;
HandleCleanup
();
}
else
if
(
SetReuseAddress
(
tcpFD
)
<
0
)
{
HandleCleanup
();
}
unsigned
int
proxyPortTCP
=
X_TCP_PORT
+
proxyPort
;
sockaddr_in
tcpAddr
;
tcpAddr
.
sin_family
=
AF_INET
;
tcpAddr
.
sin_port
=
htons
(
proxyPortTCP
);
if
(
loopbackBind
)
{
tcpAddr
.
sin_addr
.
s_addr
=
htonl
(
INADDR_LOOPBACK
);
}
else
{
tcpAddr
.
sin_addr
.
s_addr
=
htonl
(
INADDR_ANY
);
}
if
(
bind
(
tcpFD
,
(
sockaddr
*
)
&
tcpAddr
,
sizeof
(
tcpAddr
))
==
-
1
)
{
#ifdef PANIC
*
logofs
<<
"Loop: PANIC! Call to bind failed for TCP port "
<<
proxyPortTCP
<<
". Error is "
<<
EGET
()
<<
" '"
<<
ESTR
()
<<
"'.
\n
"
<<
logofs_flush
;
#endif
cerr
<<
"Error"
<<
": Call to bind failed for TCP port "
<<
proxyPortTCP
<<
". Error is "
<<
EGET
()
<<
" '"
<<
ESTR
()
<<
"'.
\n
"
;
HandleCleanup
();
}
if
(
listen
(
tcpFD
,
8
)
==
-
1
)
{
#ifdef PANIC
*
logofs
<<
"Loop: PANIC! Call to listen failed for TCP port "
<<
proxyPortTCP
<<
". Error is "
<<
EGET
()
<<
" '"
<<
ESTR
()
<<
"'.
\n
"
<<
logofs_flush
;
#endif
cerr
<<
"Error"
<<
": Call to listen failed for TCP port "
<<
proxyPortTCP
<<
". Error is "
<<
EGET
()
<<
" '"
<<
ESTR
()
<<
"'.
\n
"
;
HandleCleanup
();
}
return
1
;
return
ListenConnectionTCP
((
loopbackBind
?
"localhost"
:
"*"
),
X_TCP_PORT
+
proxyPort
,
"X11"
);
}
int
SetupUnixSocket
()
...
...
dimbor
@dimbor
mentioned in commit
82e893ef
·
Jan 26, 2018
mentioned in commit
82e893ef
mentioned in commit 82e893ef22b5d8fd1b6158c5122e31eebbb1fce9
Toggle commit list
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