MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxCloseNetwork

Function fxCloseNetwork

tools/serial2xsbug/serial2xsbug_mac.c:37–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35static void fxUnregisterSerial(void *refCon, io_service_t service, natural_t messageType, void *messageArgument);
36
37void fxCloseNetwork(txSerialTool self, uint32_t value)
38{
39 txSerialMachine* link = &(self->firstMachine);
40 txSerialMachine machine;
41 while ((machine = *link)) {
42 if ((machine->value == value) || (0 == value)) {
43 *link = machine->nextMachine;
44 if (self->currentMachine == machine)
45 self->currentMachine = NULL;
46 if (machine->networkSource) {
47 CFRunLoopRemoveSource(CFRunLoopGetCurrent(), machine->networkSource, kCFRunLoopCommonModes);
48 CFRelease(machine->networkSource);
49 }
50 if (machine->networkSocket) {
51 CFSocketInvalidate(machine->networkSocket);
52 CFRelease(machine->networkSocket);
53 }
54 free(machine);
55 }
56 else
57 link = &(machine->nextMachine);
58 }
59}
60
61void fxCloseSerial(txSerialTool self)
62{

Callers 1

fxReadSerialBufferFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected