MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / network_close

Function network_close

src/network.c:483–509  ·  view source on GitHub ↗

@cond Doxygen_Suppress

Source from the content-addressed store, hash-verified

481
482//! @cond Doxygen_Suppress
483int 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

Callers 3

rot_closeFunction · 0.85
port_closeFunction · 0.85
amp_closeFunction · 0.85

Calls 1

rig_debugFunction · 0.85

Tested by

no test coverage detected