MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / reset_sock

Function reset_sock

src/hx/libs/std/Socket.cpp:98–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96
97
98void reset_sock(Dynamic inValue)
99{
100 if (inValue.mPtr)
101 {
102 int type = inValue->__GetType();
103 if (type==vtClass)
104 {
105 inValue = inValue->__Field( HX_CSTRING("__s"), hx::paccNever );
106 if (inValue.mPtr==0)
107 return;
108 type = inValue->__GetType();
109 }
110
111 if (type==socketType) {
112 static_cast<SocketWrapper *>(inValue.mPtr)->socket = INVALID_SOCKET;
113 return;
114 }
115 }
116
117 hx::Throw(HX_CSTRING("Invalid socket handle"));
118}
119
120
121/**

Callers 1

_hx_std_socket_closeFunction · 0.85

Calls 3

ThrowFunction · 0.85
__GetTypeMethod · 0.45
__FieldMethod · 0.45

Tested by

no test coverage detected