ecs: remove ecs port option 18/16318/3
authorMunkyu Im <munkyu.im@samsung.com>
Thu, 6 Feb 2014 11:56:08 +0000 (20:56 +0900)
committerMunkyu Im <munkyu.im@samsung.com>
Thu, 13 Feb 2014 06:08:20 +0000 (15:08 +0900)
It was set dynamically.
From now on, ecs port is set "base port + 3"
Removed ecp launching command option.

Change-Id: I164865f5b6d7bd6d1f017d95c904bcf9171d9207
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
13 files changed:
package/changelog
package/pkginfo.manifest
tizen/src/ecs/ecs.c
tizen/src/ecs/ecs.h
tizen/src/emul_state.c
tizen/src/emul_state.h
tizen/src/emulator.c
tizen/src/sdb.c
tizen/src/sdb.h
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java
tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/SocketCommunicator.java
tizen/src/skin/maruskin_server.c

index 40701b6..2012ac9 100644 (file)
@@ -1,3 +1,6 @@
+* 1.7.21
+- remove ecs port option
+== Munkyu Im <munkyu.im@samsung.com> 2014-02-13
 * 1.7.20
 - modified the routine for framebuffer swapping
 == GiWoong Kim <giwoong.kim@samsung.com> 2014-01-27
index e80bc53..4f11795 100644 (file)
@@ -1,4 +1,4 @@
-Version: 1.7.20
+Version: 1.7.21
 Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
 Source: emulator
 
index ad6c4a8..b722193 100644 (file)
@@ -67,9 +67,6 @@ static ECS_State *current_ecs;
 static void* keepalive_buf;
 static int payloadsize;
 
-static int port;
-static int port_setting = -1;
-
 static int log_fd = -1;
 static int g_client_id = 1;
 
@@ -123,36 +120,6 @@ static char* get_emulator_ecs_log_path(void)
     return emulator_ecs_log_path;
 }
 
-static char* get_emulator_ecs_prop_path(void)
-{
-    int path_len = 0;
-    gchar *ecs_property_path = NULL;
-    gchar *tizen_sdk_data = NULL;
-#ifndef CONFIG_WIN32
-    char emulator_vms[] = "/emulator/vms/";
-    char ecs_prop[] = "/.ecs.properties";
-#else
-    char emulator_vms[] = "\\emulator\\vms\\";
-    char ecs_prop[] = "\\.ecs.properties";
-#endif
-    char* emul_name = get_emul_vm_name();
-
-    tizen_sdk_data = get_tizen_sdk_data_path();
-    if (!tizen_sdk_data) {
-        LOG("failed to get tizen-sdk-data path.\n");
-        return NULL;
-    }
-
-    path_len = strlen(tizen_sdk_data) + sizeof(emulator_vms) + sizeof(ecs_prop) + strlen(emul_name);
-    ecs_property_path = g_malloc(path_len + 1);
-    g_snprintf(ecs_property_path, path_len, "%s%s%s%s", tizen_sdk_data, emulator_vms, emul_name, ecs_prop);
-
-    g_free(tizen_sdk_data);
-    LOG("ecs property path: %s", ecs_property_path);
-
-    return ecs_property_path;
-}
-
 static inline void start_logging(void) {
     char* path = get_emulator_ecs_log_path();
     if (!path)
@@ -798,50 +765,6 @@ static int ecs_loop(ECS_State *cs)
 
 #endif
 
-int get_ecs_port(void) {
-    if (port_setting < 0) {
-        LOG("ecs port is not determined yet.");
-        return 0;
-    }
-    LOG("requests ecs port, and port is %d", port);
-    return port;
-}
-
-static int set_ecs_port(int port) {
-    FILE* fprop;
-    char* path = get_emulator_ecs_prop_path();
-    if (!path)
-        return -1;
-
-    fprop = fopen(path, "wt+");
-    if (fprop == NULL) {
-        return -1;
-    }
-
-    fprintf(fprop, "%d", port);
-    fclose(fprop);
-
-    g_free(path);
-
-    return 0;
-}
-
-static int setting_ecs_port(ECS_State *cs) {
-    struct sockaddr server_addr;
-    socklen_t server_len;
-
-    server_len = sizeof(server_addr);
-    memset(&server_addr, 0, sizeof(server_addr));
-    if (getsockname(cs->listen_fd, (struct sockaddr *) &server_addr, &server_len) < 0) {
-        return -1;
-    }
-
-    port = ntohs( ((struct sockaddr_in *) &server_addr)->sin_port );
-    LOG("listen port is %d", port);
-
-    return set_ecs_port(port);
-}
-
 static void* ecs_initialize(void* args) {
     int ret = 1;
     ECS_State *cs = NULL;
@@ -849,7 +772,7 @@ static void* ecs_initialize(void* args) {
     Error *local_err = NULL;
     Monitor* mon = NULL;
     char host_port[16];
-
+    int port = 0;
     start_logging();
     LOG("ecs starts initializing.");
 
@@ -867,8 +790,10 @@ static void* ecs_initialize(void* args) {
         LOG("ECS_State allocation failed.");
         return NULL;
     }
-
+    port = get_emul_ecs_port();
+    LOG("ecs port: %d", port);
     sprintf(host_port, "%d", port);
+
     qemu_opt_set(opts, "port", host_port);
     ret = socket_initialize(cs, opts);
     if (ret < 0) {
@@ -877,14 +802,6 @@ static void* ecs_initialize(void* args) {
         return NULL;
     }
 
-    if (setting_ecs_port(cs) < 0) {
-        LOG("Failed to get random port.");
-        ecs_close(cs);
-        return NULL;
-    }
-
-    port_setting = 1;
-
     mon = monitor_create();
     if (NULL == mon) {
         LOG("monitor initialization failed.");
index f27734c..b31fbf7 100644 (file)
@@ -178,7 +178,6 @@ typedef struct nfc_msg_info {
 
 int start_ecs(void);
 int stop_ecs(void);
-int get_ecs_port(void);
 
 ECS_Client *find_client(unsigned char id, unsigned char type);
 bool handle_protobuf_msg(ECS_Client* cli, char* data, const int len);
index 6d94209..31300ab 100644 (file)
@@ -144,6 +144,12 @@ void set_emul_vm_base_port(int port)
 {
     _emul_info.vm_base_port = port;
     _emul_info.device_serial_number = port + 1;
+    _emul_info.ecs_port = port + 3;
+}
+
+void set_emul_ecs_port(int port)
+{
+    _emul_info.ecs_port = port;
 }
 
 int get_emul_vm_base_port(void)
@@ -156,6 +162,10 @@ int get_device_serial_number(void)
     return _emul_info.device_serial_number;
 }
 
+int get_emul_ecs_port(void)
+{
+    return _emul_info.ecs_port;
+}
 
 /* current emulator condition */
 int get_emulator_condition(void)
index bd98720..97d7d6f 100644 (file)
@@ -90,6 +90,7 @@ typedef  struct EmulatorConfigInfo {
     int max_touch_point;
     int vm_base_port;
     int device_serial_number;
+    int ecs_port;
     char *vm_name;
     /* add here */
 } EmulatorConfigInfo;
@@ -114,6 +115,7 @@ void set_emul_input_mouse_enable(bool on);
 void set_emul_input_touch_enable(bool on);
 void set_emul_max_touch_point(int cnt);
 void set_emul_vm_base_port(int port);
+void set_emul_ecs_port(int port);
 
 void set_emulator_condition(int state);
 void set_emul_rotation(short rotation_type);
@@ -132,6 +134,7 @@ bool is_emul_input_touch_enable(void);
 int get_emul_max_touch_point(void);
 int get_emul_vm_base_port(void);
 int get_device_serial_number(void);
+int get_emul_ecs_port(void);
 
 int get_emulator_condition(void);
 short get_emul_rotation(void);
index 2e0fd51..a6b7701 100644 (file)
@@ -366,13 +366,13 @@ static void prepare_basic_features(void)
 
     qemu_add_opts(&qemu_ecs_opts);
 
-    start_ecs();
-
     get_host_proxy(http_proxy, https_proxy, ftp_proxy, socks_proxy);
     /* using "DNS" provided by default QEMU */
     g_strlcpy(dns, DEFAULT_QEMU_DNS_IP, strlen(DEFAULT_QEMU_DNS_IP) + 1);
 
-    set_sdb_base_port();
+    set_base_port();
+
+    start_ecs();
 
     check_vm_lock();
     make_vm_lock();
index f82e33d..cd4602d 100644 (file)
-/* Copyright (C) 2006-2010 The Android Open Source Project\r
-**\r
-** This software is licensed under the terms of the GNU General Public\r
-** License version 2, as published by the Free Software Foundation, and\r
-** may be copied, distributed, and modified under those terms.\r
-**\r
-** This program is distributed in the hope that it will be useful,\r
-** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-** GNU General Public License for more details.\r
-*/\r
-\r
-\r
-#include "emulator.h"\r
-#include "net/slirp.h"\r
-#include "qemu/sockets.h"\r
-#include "sdb.h"\r
-#include "include/block/nbd.h"\r
-#include "tizen/src/debug_ch.h"\r
-#include "emul_state.h"\r
-\r
-MULTI_DEBUG_CHANNEL(qemu, sdb);\r
-\r
-extern char tizen_target_path[];\r
-\r
-#ifdef _WIN32\r
-\r
-static void socket_close_handler( void*  _fd )\r
-{\r
-    int   fd = (int)_fd;\r
-    int   ret;\r
-    char  buff[64];\r
-\r
-    /* we want to drain the read side of the socket before closing it */\r
-    do {\r
-        ret = recv( fd, buff, sizeof(buff), 0 );\r
-    } while (ret < 0 && WSAGetLastError() == WSAEINTR);\r
-\r
-    if (ret < 0 && WSAGetLastError() == EWOULDBLOCK)\r
-        return;\r
-\r
-    qemu_set_fd_handler( fd, NULL, NULL, NULL );\r
-    closesocket( fd );\r
-}\r
-\r
-void socket_close( int  fd )\r
-{\r
-    int  old_errno = errno;\r
-\r
-    shutdown( fd, SD_BOTH );\r
-    /* we want to drain the socket before closing it */\r
-    qemu_set_fd_handler( fd, socket_close_handler, NULL, (void*)fd );\r
-\r
-    errno = old_errno;\r
-}\r
-\r
-#else /* !_WIN32 */\r
-\r
-#include <unistd.h>\r
-\r
-void socket_close( int  fd )\r
-{\r
-    int  old_errno = errno;\r
-\r
-    shutdown( fd, SHUT_RDWR );\r
-    close( fd );\r
-\r
-    errno = old_errno;\r
-}\r
-\r
-#endif /* !_WIN32 */\r
-\r
-int inet_strtoip(const char*  str, uint32_t  *ip)\r
-{\r
-    int  comp[4];\r
-\r
-    if (sscanf(str, "%d.%d.%d.%d", &comp[0], &comp[1], &comp[2], &comp[3]) != 4)\r
-        return -1;\r
-\r
-    if ((unsigned)comp[0] >= 256 ||\r
-            (unsigned)comp[1] >= 256 ||\r
-            (unsigned)comp[2] >= 256 ||\r
-            (unsigned)comp[3] >= 256)\r
-        return -1;\r
-\r
-    *ip = (uint32_t)((comp[0] << 24) | (comp[1] << 16) |\r
-            (comp[2] << 8)  |  comp[3]);\r
-    return 0;\r
-}\r
-\r
-int check_port_bind_listen(uint32_t port)\r
-{\r
-    struct sockaddr_in addr;\r
-    int s, opt = 1;\r
-    int ret = -1;\r
-    socklen_t addrlen = sizeof(addr);\r
-    memset(&addr, 0, addrlen);\r
-\r
-    addr.sin_family = AF_INET;\r
-    addr.sin_addr.s_addr = INADDR_ANY;\r
-    addr.sin_port = htons(port);\r
-\r
-    if (((s = qemu_socket(AF_INET, SOCK_STREAM, 0)) < 0) ||\r
-#ifndef _WIN32\r
-            (setsockopt(s, SOL_SOCKET,SO_REUSEADDR, (char *)&opt, sizeof(int)) < 0) ||\r
-#endif\r
-            (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) ||\r
-            (listen(s, 1) < 0)) {\r
-\r
-        /* fail */\r
-        ret = -1;\r
-        ERR( "port(%d) listen  fail \n", port);\r
-    }else{\r
-        /*fsucess*/\r
-        ret = 1;\r
-        INFO( "port(%d) listen  ok \n", port);\r
-    }\r
-\r
-#ifdef _WIN32\r
-    closesocket(s);\r
-#else\r
-    close(s);\r
-#endif\r
-\r
-    return ret;\r
-}\r
-\r
-void set_sdb_base_port(void)\r
-{\r
-    int   tries     = 10;\r
-    int   success   = 0;\r
-    uint32_t port = 26100;\r
-    int base_port;\r
-\r
-    base_port = get_emul_vm_base_port();\r
-\r
-    if(base_port == 0){\r
-\r
-        for ( ; tries > 0; tries--, port += 10 ) {\r
-            if(check_port_bind_listen(port + 1) < 0 )\r
-                continue;\r
-\r
-            success = 1;\r
-            break;\r
-        }\r
-\r
-        if (!success) {\r
-            ERR( "it seems too many emulator instances are running on this machine. Aborting\n" );\r
-            exit(1);\r
-        }\r
-\r
-        base_port = port;\r
-        INFO( "sdb port is %d \n", base_port);\r
-    }\r
-\r
-    set_emul_vm_base_port(base_port);\r
-}\r
-\r
-void sdb_setup(void)\r
-{\r
-    int   tries     = 10;\r
-    int   success   = 0;\r
-    uint32_t  guest_ip;\r
-    char buf[64] = {0,};\r
-    int number;\r
-\r
-    number = get_device_serial_number();\r
-\r
-    inet_strtoip("10.0.2.16", &guest_ip);\r
-\r
-    for ( ; tries > 0; tries--, number += 10 ) {\r
-        // redir form [tcp:26101:10.0.2.16:26101]\r
-        sprintf(buf, "tcp:%d:10.0.2.16:26101", number);\r
-        if(net_slirp_redir((char*)buf) < 0)\r
-            continue;\r
-\r
-        INFO( "SDBD established on port %d\n", number);\r
-        success = 1;\r
-        break;\r
-    }\r
-\r
-    INFO("redirect [%s] success\n", buf);\r
-    if (!success) {\r
-        ERR( "it seems too many emulator instances are running on this machine. Aborting\n" );\r
-        exit(1);\r
-    }\r
-\r
-    INFO( "Port(%d/tcp) listen for SDB \n", number);\r
-\r
-    /* for sensort */\r
-    sprintf(buf, "tcp:%d:10.0.2.16:3577", number + SDB_TCP_EMULD_INDEX );\r
-    if(net_slirp_redir((char*)buf) < 0){\r
-        ERR( "redirect [%s] fail \n", buf);\r
-    }else{\r
-        INFO("redirect [%s] success\n", buf);\r
-    }\r
-}\r
-\r
-int sdb_loopback_client(int port, int type)\r
-{\r
-    struct sockaddr_in addr;\r
-    int s;\r
-\r
-    memset(&addr, 0, sizeof(addr));\r
-    addr.sin_family = AF_INET;\r
-    addr.sin_port = htons(port);\r
-    addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\r
-\r
-    s = socket(AF_INET, type, 0);\r
-    if(s < 0) return -1;\r
-\r
-    if(connect(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) {\r
-        close(s);\r
-        return -1;\r
-    }\r
-\r
-    return s;\r
-\r
-}\r
+/* Copyright (C) 2006-2010 The Android Open Source Project
+**
+** This software is licensed under the terms of the GNU General Public
+** License version 2, as published by the Free Software Foundation, and
+** may be copied, distributed, and modified under those terms.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU General Public License for more details.
+*/
+
+
+#include "emulator.h"
+#include "net/slirp.h"
+#include "qemu/sockets.h"
+#include "sdb.h"
+#include "include/block/nbd.h"
+#include "tizen/src/debug_ch.h"
+#include "emul_state.h"
+
+MULTI_DEBUG_CHANNEL(qemu, sdb);
+
+extern char tizen_target_path[];
+
+#ifdef _WIN32
+
+static void socket_close_handler( void*  _fd )
+{
+    int   fd = (int)_fd;
+    int   ret;
+    char  buff[64];
+
+    /* we want to drain the read side of the socket before closing it */
+    do {
+        ret = recv( fd, buff, sizeof(buff), 0 );
+    } while (ret < 0 && WSAGetLastError() == WSAEINTR);
+
+    if (ret < 0 && WSAGetLastError() == EWOULDBLOCK)
+        return;
+
+    qemu_set_fd_handler( fd, NULL, NULL, NULL );
+    closesocket( fd );
+}
+
+void socket_close( int  fd )
+{
+    int  old_errno = errno;
+
+    shutdown( fd, SD_BOTH );
+    /* we want to drain the socket before closing it */
+    qemu_set_fd_handler( fd, socket_close_handler, NULL, (void*)fd );
+
+    errno = old_errno;
+}
+
+#else /* !_WIN32 */
+
+#include <unistd.h>
+
+void socket_close( int  fd )
+{
+    int  old_errno = errno;
+
+    shutdown( fd, SHUT_RDWR );
+    close( fd );
+
+    errno = old_errno;
+}
+
+#endif /* !_WIN32 */
+
+int inet_strtoip(const char*  str, uint32_t  *ip)
+{
+    int  comp[4];
+
+    if (sscanf(str, "%d.%d.%d.%d", &comp[0], &comp[1], &comp[2], &comp[3]) != 4)
+        return -1;
+
+    if ((unsigned)comp[0] >= 256 ||
+            (unsigned)comp[1] >= 256 ||
+            (unsigned)comp[2] >= 256 ||
+            (unsigned)comp[3] >= 256)
+        return -1;
+
+    *ip = (uint32_t)((comp[0] << 24) | (comp[1] << 16) |
+            (comp[2] << 8)  |  comp[3]);
+    return 0;
+}
+
+int check_port_bind_listen(uint32_t port)
+{
+    struct sockaddr_in addr;
+    int s, opt = 1;
+    int ret = -1;
+    socklen_t addrlen = sizeof(addr);
+    memset(&addr, 0, addrlen);
+
+    addr.sin_family = AF_INET;
+    addr.sin_addr.s_addr = INADDR_ANY;
+    addr.sin_port = htons(port);
+
+    s = qemu_socket(AF_INET, SOCK_STREAM, 0);
+    if (s < 0) {
+        ERR("failed to create a socket\n", port);
+        return -1;
+    }
+
+#ifndef _WIN32
+    ret = setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
+                    (char *)&opt, sizeof(int));
+    if (ret < 0) {
+        ERR("setsockopt failure\n");
+        close(s);
+        return -1;
+    }
+#endif
+
+    if ((bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) ||
+        (listen(s, 1) < 0)) {
+        /* failure */
+        ret = -1;
+        ERR("port(%d) listen failure\n", port);
+    } else {
+        /* success */
+        ret = 1;
+        INFO("port(%d) listen success\n", port);
+    }
+
+#ifdef _WIN32
+    closesocket(s);
+#else
+    close(s);
+#endif
+
+    return ret;
+}
+
+void set_base_port(void)
+{
+    int   tries     = 10;
+    int   success   = 0;
+    uint32_t port = 26100;
+    int base_port;
+
+    base_port = get_emul_vm_base_port();
+
+    if(base_port == 0){
+
+        for ( ; tries > 0; tries--, port += 10 ) {
+            if(check_port_bind_listen(port + 1) < 0 )
+                continue;
+
+            success = 1;
+            break;
+        }
+
+        if (!success) {
+            ERR( "it seems too many emulator instances are running on this machine. Aborting\n" );
+            exit(1);
+        }
+
+        base_port = port;
+        INFO( "sdb port is %d \n", base_port);
+    }
+
+    set_emul_vm_base_port(base_port);
+}
+
+void sdb_setup(void)
+{
+    int   tries     = 10;
+    int   success   = 0;
+    uint32_t  guest_ip;
+    char buf[64] = {0,};
+    int number;
+
+    number = get_device_serial_number();
+
+    inet_strtoip("10.0.2.16", &guest_ip);
+
+    for ( ; tries > 0; tries--, number += 10 ) {
+        // redir form [tcp:26101:10.0.2.16:26101]
+        sprintf(buf, "tcp:%d:10.0.2.16:26101", number);
+        if(net_slirp_redir((char*)buf) < 0)
+            continue;
+
+        INFO( "SDBD established on port %d\n", number);
+        success = 1;
+        break;
+    }
+
+    INFO("redirect [%s] success\n", buf);
+    if (!success) {
+        ERR( "it seems too many emulator instances are running on this machine. Aborting\n" );
+        exit(1);
+    }
+
+    INFO( "Port(%d/tcp) listen for SDB \n", number);
+}
+
+int sdb_loopback_client(int port, int type)
+{
+    struct sockaddr_in addr;
+    int s;
+
+    memset(&addr, 0, sizeof(addr));
+    addr.sin_family = AF_INET;
+    addr.sin_port = htons(port);
+    addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+
+    s = socket(AF_INET, type, 0);
+    if(s < 0) return -1;
+
+    if(connect(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
+        close(s);
+        return -1;
+    }
+
+    return s;
+
+}
index 66a01ca..2e1acfc 100644 (file)
@@ -34,7 +34,7 @@
 #define SDB_UDP_SENSOR_INDEX  2   /* sensor server port */
 
 void sdb_setup(void);
-void set_sdb_base_port(void);
+void set_base_port(void);
 int inet_strtoip(const char*  str, uint32_t  *ip);
 int socket_send(int fd, const void*  buf, int  buflen);
 void socket_close(int fd);
index 9ad8b4d..b01b88a 100755 (executable)
@@ -1778,63 +1778,37 @@ public class EmulatorSkin {
                                        }
 
                                        return;
-                               }
-
-                               // TODO: thread
-                               /* get ECS port from Qemu */
-                               DataTranfer dataTranfer = communicator.sendDataToQEMU(
-                                               SendCommand.SEND_ECP_PORT_REQ, null, true);
-                               byte[] receivedData = communicator.getReceivedData(dataTranfer);
-
-                               if (null != receivedData) {
-                                       int portEcp = (receivedData[0] & 0xFF) << 24;
-                                       portEcp |= (receivedData[1] & 0xFF) << 16;
-                                       portEcp |= (receivedData[2] & 0xFF) << 8;
-                                       portEcp |= (receivedData[3] & 0xFF);
+                }
 
-                                       if (portEcp <= 0) {
-                                               logger.log(Level.INFO, "ECS port failed : " + portEcp);
+                String emulName = SkinUtil.getVmName(config);
+                int portSdb = config.getArgInt(ArgsConstants.VM_BASE_PORT);
 
-                                               SkinUtil.openMessage(shell, null,
-                                                               "Failed to connect to Control Server. Please restart the emulator.",
-                                                               SWT.ICON_ERROR, config);
-                                               return;
-                                       }
+                               ProcessBuilder procEcp = new ProcessBuilder();
 
-                                       String emulName = SkinUtil.getVmName(config);
-                                       int portSdb = config.getArgInt(ArgsConstants.VM_BASE_PORT);
-
-                                       ProcessBuilder procEcp = new ProcessBuilder();
-
-                                       // FIXME: appropriate running binary setting is necessary.
-                                       if (SwtUtil.isWindowsPlatform()) {
-                                               procEcp.command("java.exe", "-jar", ecpPath,
-                                                               "vmname=" + emulName, "sdb.port=" + portSdb,
-                                                               "svr.port=" + portEcp);
-                                       } else if (SwtUtil.isMacPlatform()) {
-                                               procEcp.command("java", "-jar", "-XstartOnFirstThread", ecpPath,
-                                                               "vmname=" + emulName, "sdb.port=" + portSdb,
-                                                               "svr.port=" + portEcp);
-                                       } else { /* Linux */
-                                               procEcp.command("java", "-jar", ecpPath,
-                                                               "vmname=" + emulName, "sdb.port=" + portSdb,
-                                                               "svr.port=" + portEcp);
-                                       }
+                               // FIXME: appropriate running binary setting is necessary.
+                               if (SwtUtil.isWindowsPlatform()) {
+                                       procEcp.command("java.exe", "-jar", ecpPath, "vmname="
+                                                       + emulName, "base.port=" + portSdb);
+                               } else if (SwtUtil.isMacPlatform()) {
+                                       procEcp.command("java", "-jar", "-XstartOnFirstThread",
+                                                       ecpPath, "vmname=" + emulName, "base.port="
+                                                                       + portSdb);
+                               } else { /* Linux */
+                                       procEcp.command("java", "-jar", ecpPath, "vmname="
+                                                       + emulName, "base.port=" + portSdb);
+                               }
 
-                                       logger.info(procEcp.command().toString());
+                               logger.info(procEcp.command().toString());
 
-                                       try {
-                                               procEcp.start(); /* open ECP */
-                                       } catch (Exception ee) {
-                                               logger.log(Level.SEVERE, ee.getMessage(), ee);
-                                               SkinUtil.openMessage(shell, null,
-                                                               "Fail to open control panel : \n" + ee.getMessage(),
-                                                               SWT.ICON_ERROR, config);
-                                       }
-                               } else {
-                                       logger.severe("Fail to get ECP data");
-                                       SkinUtil.openMessage(shell, null,
-                                                       "Fail to get ECP data", SWT.ICON_ERROR, config);
+                               try {
+                                       procEcp.start(); /* open ECP */
+                               } catch (Exception ee) {
+                                       logger.log(Level.SEVERE, ee.getMessage(), ee);
+                                       SkinUtil.openMessage(
+                                                       shell,
+                                                       null,
+                                                       "Fail to open control panel : \n" + ee.getMessage(),
+                                                       SWT.ICON_ERROR, config);
                                }
                        }
                };
index beffaf6..7bef8df 100644 (file)
@@ -202,7 +202,6 @@ public interface ICommunicator extends Runnable {
                SEND_DETAIL_INFO_REQ((short) 17),
                SEND_RAM_DUMP((short) 18),
                SEND_GUEST_DUMP((short) 19),
-               SEND_ECP_PORT_REQ((short) 20),
                SEND_INTERPOLATION_STATE((short) 21),
 
                RESPONSE_HEART_BEAT((short) 900),
index 6555aa8..d925ea3 100755 (executable)
@@ -618,8 +618,6 @@ public class SocketCommunicator implements ICommunicator {
                                dataTranfer = resetDataTransfer(screenShotDataTransfer);
                        } else if (SendCommand.SEND_DETAIL_INFO_REQ.equals(command)) {
                                dataTranfer = resetDataTransfer(detailInfoTransfer);
-                       } else if (SendCommand.SEND_ECP_PORT_REQ.equals(command)) {
-                               dataTranfer = resetDataTransfer(ecpTransfer);
                        }
                }
 
index 6ee3996..bb5e58d 100644 (file)
@@ -111,7 +111,6 @@ enum {
     RECV_DETAIL_INFO_REQ = 17,
     RECV_RAM_DUMP = 18,
     RECV_GUESTMEMORY_DUMP = 19,
-    RECV_ECP_PORT_REQ = 20,
     RECV_INTERPOLATION_STATE = 21,
 
     RECV_RESPONSE_HEART_BEAT = 900,
@@ -1062,21 +1061,6 @@ static void* run_skin_server(void* args)
                     do_ram_dump();
                     break;
                 }
-                case RECV_ECP_PORT_REQ: {
-                    log_cnt += sprintf(log_buf + log_cnt, "RECV_ECP_PORT_REQ ==\n");
-                    TRACE(log_buf);
-
-                    int port = get_ecs_port();
-                    unsigned char port_buf[5];
-                    memset(port_buf, 0, 5);
-                    port_buf[0] = (port & 0xFF000000) >> 24;
-                    port_buf[1] = (port & 0x00FF0000) >> 16;
-                    port_buf[2] = (port & 0x0000FF00) >> 8;
-                    port_buf[3] = (port & 0x000000FF);
-
-                    send_skin_data(client_sock, SEND_ECP_PORT_DATA, port_buf, 4, 0);
-                    break;
-                }
                 case RECV_GUESTMEMORY_DUMP: {
                     log_cnt += sprintf(log_buf + log_cnt, "RECV_GUESTMEMORY_DUMP ==\n");
                     TRACE(log_buf);