Fix emulator core and UI on Windows
There are two parts in this CL:
1. Fixing the Windows build (missing set_fd_handler)
2. Replacing read/write with socket_recv/socket_send.
Change-Id: I5fa599774260257d481b738a892e1124135fc319
diff --git a/android/protocol/ui-commands-impl.c b/android/protocol/ui-commands-impl.c
index e933d57..2ceeca1 100644
--- a/android/protocol/ui-commands-impl.c
+++ b/android/protocol/ui-commands-impl.c
@@ -124,8 +124,9 @@
// Read requests while they are immediately available.
for (;;) {
// Read next chunk of data.
- status = read(uicmd->sock, uicmd->reader_buffer + uicmd->reader_offset,
- uicmd->reader_bytes - uicmd->reader_offset);
+ status = socket_recv(uicmd->sock,
+ uicmd->reader_buffer + uicmd->reader_offset,
+ uicmd->reader_bytes - uicmd->reader_offset);
if (status == 0) {
/* Disconnection, meaning that the core process got terminated. */
fprintf(stderr, "core-ui-control service got disconnected\n");