Let socket library return correct socket number in all cases.
This commit is contained in:
parent
fcf540af8e
commit
06f88ef296
1 changed files with 10 additions and 1 deletions
|
@ -283,8 +283,17 @@ void Socket::Connection::drop() {
|
|||
|
||||
/// Returns internal socket number.
|
||||
int Socket::Connection::getSocket() {
|
||||
if (sock != -1){
|
||||
return sock;
|
||||
}
|
||||
if (pipes[0] != -1) {
|
||||
return pipes[0];
|
||||
}
|
||||
if (pipes[1] != -1) {
|
||||
return pipes[1];
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// Returns a string describing the last error that occured.
|
||||
/// Only reports errors if an error actually occured - returns the host address or empty string otherwise.
|
||||
|
|
Loading…
Add table
Reference in a new issue