MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / translateNativeSocketError

Function translateNativeSocketError

source/kernel/knativesocket.cpp:245–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245S32 translateNativeSocketError(const std::shared_ptr<KNativeSocketObject>& s, int error) {
246 S32 result = 0;
247#ifdef WIN32
248 if (error == WSAENOTCONN) {
249 result = -K_ENOTCONN;
250 LOG_SOCK(" native socket: %x error %s(%x)", s->nativeSocket, "ENOTCONN", result);
251 }
252 else if (error == WSAEWOULDBLOCK) {
253 result = -K_EWOULDBLOCK;
254 LOG_SOCK(" native socket: %x error %s(%x)", s->nativeSocket, "EWOULDBLOCK", result);
255 }
256 else if (error == WSAETIMEDOUT) {
257 result = -K_ETIMEDOUT;
258 LOG_SOCK(" native socket: %x error %s(%x)", s->nativeSocket, "ETIMEDOUT", result);
259 }
260 else if (error == WSAECONNRESET) {
261 result = -K_ECONNRESET;
262 LOG_SOCK(" native socket: %x error %s(%x)", s->nativeSocket, "ECONNRESET", result);
263 }
264 else if (error == WSAEDESTADDRREQ) {
265 result = -K_EDESTADDRREQ;
266 LOG_SOCK(" native socket: %x error %s(%x)", s->nativeSocket, "EDESTADDRREQ", result);
267 }
268 else if (error == WSAEHOSTUNREACH) {
269 result = -K_EHOSTUNREACH;
270 LOG_SOCK(" native socket: %x error %s(%x)", s->nativeSocket, "EHOSTUNREACH", result);
271 }
272 else if (error == WSAECONNREFUSED) {
273 result = -K_ECONNREFUSED;
274 LOG_SOCK(" native socket: %x error %s(%x)", s->nativeSocket, "ECONNREFUSED", result);
275 }
276 else if (error == WSAEISCONN) {
277 result = -K_EISCONN;
278 LOG_SOCK(" native socket: %x error %s(%x)", s->nativeSocket, "EISCONN", result);
279 }
280 else if (error == WSAEMSGSIZE) {
281 result = -K_EMSGSIZE;
282 LOG_SOCK(" native socket: %x error %s(%x)", s->nativeSocket, "EMSGSIZE", result);
283 }
284 else {
285 result = -K_EIO;
286 LOG_SOCK(" native socket: %x error %s(%x)", s->nativeSocket, "EIO", result);
287 }
288
289#else
290 if (error == ENOTCONN) {
291 result = -K_ENOTCONN;
292 LOG_SOCK(" native socket: %x error %s(%x)", s->nativeSocket, "ENOTCONN", error);
293 }
294 else if (error == EWOULDBLOCK) {
295 result = -K_EWOULDBLOCK;
296 LOG_SOCK(" native socket: %x error %s(%x)", s->nativeSocket, "EWOULDBLOCK", error);
297 }
298 else if (error == ETIMEDOUT) {
299 result = -K_ETIMEDOUT;
300 LOG_SOCK(" native socket: %x error %s(%x)", s->nativeSocket, "ETIMEDOUT", error);
301 }
302 else if (error == ECONNRESET) {

Callers 2

handleNativeSocketErrorFunction · 0.85
connectMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected