mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Added a function to get SO_ERROR on a socket.
This commit is contained in:
parent
86315fed3d
commit
d5152752d2
2 changed files with 14 additions and 0 deletions
|
@ -1989,6 +1989,15 @@ int setSockTimeout(int sock, int opt, unsigned long timeout_usec) { // opt = SO_
|
||||||
return setsockopt(sock, SOL_SOCKET, opt, (char*)&optval, sizeof(optval));
|
return setsockopt(sock, SOL_SOCKET, opt, (char*)&optval, sizeof(optval));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getSockError(int sock) {
|
||||||
|
int result = 0;
|
||||||
|
socklen_t result_len = sizeof(result);
|
||||||
|
if (getsockopt(sock, SOL_SOCKET, SO_ERROR, (char*)&result, &result_len) < 0) {
|
||||||
|
result = errno;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
int getSockNoDelay(int tcpsock) {
|
int getSockNoDelay(int tcpsock) {
|
||||||
int opt = 0;
|
int opt = 0;
|
||||||
socklen_t optlen = sizeof(opt);
|
socklen_t optlen = sizeof(opt);
|
||||||
|
|
|
@ -1340,6 +1340,11 @@ int setSockMSS(int sock, int size);
|
||||||
*/
|
*/
|
||||||
int setSockTimeout(int sock, int opt, unsigned long timeout_usec);
|
int setSockTimeout(int sock, int opt, unsigned long timeout_usec);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get Socket SO_ERROR (Requests and clears pending error information on the socket)
|
||||||
|
*/
|
||||||
|
int getSockError(int sock);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get TCP Socket TCP_NODELAY (Nagle Algo)
|
* Get TCP Socket TCP_NODELAY (Nagle Algo)
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue