| 1350 | } |
| 1351 | |
| 1352 | int CSockLink::InputNotify() |
| 1353 | { |
| 1354 | int32_t ret = 0; |
| 1355 | |
| 1356 | this->_last_access = mt_time_ms(); |
| 1357 | |
| 1358 | if (_proto_type == NET_PROTO_UDP) |
| 1359 | { |
| 1360 | ret = cache_udp_recv(&_recv_cache, _fd, NULL); |
| 1361 | } |
| 1362 | else |
| 1363 | { |
| 1364 | ret = cache_tcp_recv(&_recv_cache, _fd); |
| 1365 | } |
| 1366 | |
| 1367 | if (ret < 0) |
| 1368 | { |
| 1369 | if (ret == -SK_ERR_NEED_CLOSE) |
| 1370 | { |
| 1371 | MTLOG_DEBUG("recv on link failed, remote close"); |
| 1372 | _errno = RC_REMOTE_CLOSED; |
| 1373 | } |
| 1374 | else |
| 1375 | { |
| 1376 | MTLOG_ERROR("recv on link failed, close it, ret %d[%m]", ret); |
| 1377 | _errno = RC_RECV_FAIL; |
| 1378 | } |
| 1379 | |
| 1380 | this->Destroy(); |
| 1381 | return -1; |
| 1382 | } |
| 1383 | |
| 1384 | ret = this->RecvDispath(); |
| 1385 | if (ret < 0) |
| 1386 | { |
| 1387 | MTLOG_DEBUG("recv dispath failed, close it, ret %d[%m]", ret); |
| 1388 | this->Destroy(); |
| 1389 | return -2; |
| 1390 | } |
| 1391 | |
| 1392 | return 0; |
| 1393 | |
| 1394 | } |
| 1395 | |
| 1396 | int CSockLink::OutputNotify() |
| 1397 | { |
nothing calls this directly
no test coverage detected