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

Function fxReadNetwork

tools/serial2xsbug/serial2xsbug_mac.c:232–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232void fxReadNetwork(CFSocketRef socketRef, CFSocketCallBackType cbType, CFDataRef addr, const void* data, void* context)
233{
234 txSerialMachine machine = context;
235 CFSocketNativeHandle handle = CFSocketGetNative(socketRef);
236 char buffer[256];
237 int size = read(handle, buffer, 256);
238 if (size > 0)
239 fxReadNetworkBuffer(machine, buffer, size);
240 else if ((size < 0) && (errno != EINPROGRESS)) {
241 fprintf(stderr, "Error reading network - %s(%d).\n", strerror(errno), errno);
242 exit(1);
243 }
244}
245
246void fxReadSerial(CFSocketRef socketRef, CFSocketCallBackType cbType, CFDataRef addr, const void* data, void* context)
247{

Callers

nothing calls this directly

Calls 2

fxReadNetworkBufferFunction · 0.85
readFunction · 0.50

Tested by

no test coverage detected