| 230 | } |
| 231 | |
| 232 | void 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 | |
| 246 | void fxReadSerial(CFSocketRef socketRef, CFSocketCallBackType cbType, CFDataRef addr, const void* data, void* context) |
| 247 | { |
nothing calls this directly
no test coverage detected