exit(STATUS_CONTROL_C_EXIT);
return TRUE;
}
+static void *local_init_thread(void *x);
#endif
void sdb_cleanup(void)
install_listener(DEFAULT_SDB_QEMU_PORT, 0, NULL, qemuListener);
sdb_usb_init();
+
+#ifdef OS_WINDOWS
+ sdb_thread_t thr;
+ void* (*func)(void *);
+ func = local_init_thread;
+ if(sdb_thread_create(&thr, func, NULL)) {
+ LOG_INFO("failed to create local init thread\n");
+ local_init(DEFAULT_SDB_LOCAL_TRANSPORT_PORT);
+ }
+#else
local_init(DEFAULT_SDB_LOCAL_TRANSPORT_PORT);
+#endif
LOG_INFO("Event loop starting\n");
FDEVENT_LOOP();
return 0;
}
+#ifdef OS_WINDOWS
+static void *local_init_thread(void *x) {
+ int port = DEFAULT_SDB_LOCAL_TRANSPORT_PORT;
+ int count = SDB_LOCAL_TRANSPORT_MAX;
+
+ LOG_INFO("try to connect to emulator instances when booting sdb server up\n");
+ for (; count > 0; count--, port += 10) {
+ (void) local_connect(port, NULL);
+ }
+}
+#endif
+
static void local_init(int port)
{
if(port < 1024) {
char buf[64];
- // in case of windows, it takes a long time to connect localhost compare to linux
+/* FIXED : send connection request in thread on windows in sdb booting time
+ to prevent emulator with no shared memory information being not detected */
+/*
#if defined(OS_WINDOWS)
char devname[DEVICENAME_MAX]={0,};
if (get_devicename_from_shdmem(sdb_port, devname) == -1) {
s_strncpy(devname, DEFAULT_DEVICENAME, DEVICENAME_MAX);
}
#endif
+*/
char* host = "127.0.0.1";
int fd = sdb_host_connect(host, sdb_port, SOCK_STREAM);