| 237 | } |
| 238 | |
| 239 | void doClose(xsMachine *the, xsSlot *instance) |
| 240 | { |
| 241 | TCP tcp = xsmcGetHostData(*instance); |
| 242 | if (tcp && xsmcGetHostDataValidate(*instance, (void *)&xsTCPHooks)) { |
| 243 | if (tcp->triggered) |
| 244 | tcpRelease(tcp); |
| 245 | |
| 246 | tcp->done = 1; |
| 247 | tcp->triggerable = 0; |
| 248 | tcp->triggered = 0; |
| 249 | |
| 250 | if (tcp->task) { |
| 251 | modTimerRemove(tcp->task); |
| 252 | tcp->task = NULL; |
| 253 | } |
| 254 | |
| 255 | xsmcSetHostData(*instance, NULL); |
| 256 | xsForget(tcp->obj); |
| 257 | xsmcSetHostDestructor(*instance, NULL); |
| 258 | tcpRelease(tcp); |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | void xs_tcp_close(xsMachine *the) |
| 263 | { |
no test coverage detected