MCPcopy Create free account
hub / github.com/HumbleNet/HumbleNet / internal_close_socket

Function internal_close_socket

src/humblenet/src/libsocket.cpp:453–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

451}
452
453void internal_close_socket( internal_socket_t* socket ) {
454 if( socket->closing )
455 // socket clos process has already started, ignore the request.
456 return;
457 else if( socket->wsi ) {
458 libwebsocket_callback_on_writable(g_context->websocket, socket->wsi);
459 // TODO: How do we clean up ?
460 } else if( socket->webrtc ) {
461 // this will trigger the destruction of the channel and thus the destruction of our socket object.
462 socket->closing = true;
463 libwebrtc_close_connection( socket->webrtc );
464 } else {
465 assert( "Destroyed socket passed to close" == NULL );
466 }
467}
468
469int internal_write_socket(internal_socket_t* socket, const void *buf, int bufsize) {
470 if( socket->wsi ) {

Callers 3

disconnectMethod · 0.85
run_message_testFunction · 0.85

Tested by 1

run_message_testFunction · 0.68