Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
9705f748
Commit
9705f748
authored
Aug 23, 2016
by
Steven Murray
Browse files
Trying a simplified version of connectWithTimeout()
parent
b0062284
Changes
1
Hide whitespace changes
Inline
Side-by-side
tapeserver/castor/io/io.cpp
View file @
9705f748
...
...
@@ -965,35 +965,6 @@ int castor::io::connectWithTimeout(
throw
ex
;
}
// Throw an exception if there was an error condition on the file descriptor
if
(
pollFd
.
revents
&
POLLERR
)
{
castor
::
exception
::
Exception
ex
;
ex
.
getMessage
()
<<
"Failed to accept connection"
": POLLERR - Error condition"
;
if
(
pollFd
.
revents
&
POLLHUP
)
{
ex
.
getMessage
()
<<
": POLLHUP - Connection closed by peer"
;
}
if
(
pollFd
.
revents
&
POLLNVAL
)
{
ex
.
getMessage
()
<<
": POLLNVAL - File descriptor not open"
;
}
ex
.
getMessage
()
<<
": pollFd.fd="
<<
pollFd
.
fd
<<
",pollFd.events="
<<
pollFd
.
events
<<
",pollFd.revents="
<<
pollFd
.
revents
;
throw
ex
;
}
// Throw an exception if no file descriptor was set
if
(
!
(
pollFd
.
revents
&
POLLIN
)
&&
!
(
pollFd
.
revents
&
POLLOUT
))
{
castor
::
exception
::
Exception
ex
(
ECANCELED
);
ex
.
getMessage
()
<<
"Failed to connect"
": poll() returned without POLLIN or POLLOUT set"
": pollFd.fd="
<<
pollFd
.
fd
<<
",pollFd.events="
<<
pollFd
.
events
<<
",pollFd.revents="
<<
pollFd
.
revents
;
throw
ex
;
}
// Use getsockopt() to check whether or not the connection completed
// successfully
//
...
...
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