aboutsummaryrefslogtreecommitdiffstats
path: root/android/sync-utils.c
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2011-01-19 18:29:27 -0800
committerVladimir Chtchetkine <vchtchetkine@google.com>2011-01-19 18:29:27 -0800
commit9411a562e1ab772732a4d5147c9103a638837c82 (patch)
treebf11eddce29c02b4376bc0cb76e5f9233791cf39 /android/sync-utils.c
parenta9edc435e6592fcc001e21e150391a84bde114a6 (diff)
downloadexternal_qemu-9411a562e1ab772732a4d5147c9103a638837c82.zip
external_qemu-9411a562e1ab772732a4d5147c9103a638837c82.tar.gz
external_qemu-9411a562e1ab772732a4d5147c9103a638837c82.tar.bz2
Implement user event transmission between the UI and the core
Change-Id: I503aa691cada5250b76167a923d4a226d20ee41d
Diffstat (limited to 'android/sync-utils.c')
-rw-r--r--android/sync-utils.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/android/sync-utils.c b/android/sync-utils.c
index c5674b2..32c803c 100644
--- a/android/sync-utils.c
+++ b/android/sync-utils.c
@@ -25,6 +25,7 @@
#include "sockets.h"
#include "android/utils/debug.h"
#include "android/sync-utils.h"
+#include "android/utils/system.h"
#define D(...) do { if (VERBOSE_CHECK(init)) dprint(__VA_ARGS__); } while (0)
@@ -37,11 +38,24 @@ struct SyncSocket {
};
SyncSocket*
+syncsocket_init(int fd)
+{
+ SyncSocket* sync_socket;
+ ANEW0(sync_socket);
+
+ socket_set_nonblock(fd);
+ sync_socket->iolooper = iolooper_new();
+ sync_socket->fd = fd;
+
+ return sync_socket;
+}
+
+SyncSocket*
syncsocket_connect(int fd, SockAddress* sockaddr, int timeout)
{
- IoLooper* looper = NULL;
+ IoLooper* looper;
int connect_status;
- SyncSocket* sync_socket;
+ SyncSocket* sync_socket = NULL;
socket_set_nonblock(fd);