@cond Doxygen_Suppress
| 481 | |
| 482 | //! @cond Doxygen_Suppress |
| 483 | int network_close(hamlib_port_t *rp) |
| 484 | { |
| 485 | int ret = 0; |
| 486 | |
| 487 | if (rp->fd > 0) |
| 488 | { |
| 489 | #ifdef __MINGW32__ |
| 490 | ret = closesocket(rp->fd); |
| 491 | #else |
| 492 | ret = close(rp->fd); |
| 493 | #endif |
| 494 | rig_debug(RIG_DEBUG_VERBOSE, "%s: close socket ret=%d\n", __func__, ret); |
| 495 | rp->fd = 0; |
| 496 | } |
| 497 | |
| 498 | #ifdef __MINGW32__ |
| 499 | |
| 500 | if (wsstarted) |
| 501 | { |
| 502 | ret = WSACleanup(); |
| 503 | rig_debug(RIG_DEBUG_VERBOSE, "%s: WSACleanup ret=%d\n", __func__, ret); |
| 504 | wsstarted = 0; |
| 505 | } |
| 506 | |
| 507 | #endif |
| 508 | return (ret); |
| 509 | } |
| 510 | //! @endcond |
| 511 | |
| 512 | //TODO See defn in rig.c |
no test coverage detected