Commit 07e5f883 authored by winckel's avatar winckel

Removed set title for socket thread.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4945 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 46ae17e7
...@@ -319,8 +319,6 @@ void *socket_thread_fct(void *arg) ...@@ -319,8 +319,6 @@ void *socket_thread_fct(void *arg)
tv.tv_sec = 0; tv.tv_sec = 0;
tv.tv_usec = 1000 * SOCKET_MS_BEFORE_SIGNALLING; tv.tv_usec = 1000 * SOCKET_MS_BEFORE_SIGNALLING;
ui_set_title ("connecting to %s:%d ...", socket_data->ip_address, socket_data->port);
do { do {
/* Connecting to remote peer */ /* Connecting to remote peer */
ret = connect(socket_data->sd, (struct sockaddr *) &si_me, sizeof(struct sockaddr_in)); ret = connect(socket_data->sd, (struct sockaddr *) &si_me, sizeof(struct sockaddr_in));
...@@ -340,8 +338,6 @@ void *socket_thread_fct(void *arg) ...@@ -340,8 +338,6 @@ void *socket_thread_fct(void *arg)
} }
} while (ret < 0); } while (ret < 0);
ui_set_title ("%s:%d", socket_data->ip_address, socket_data->port);
/* Set the socket as non-blocking */ /* Set the socket as non-blocking */
fcntl(socket_data->sd, F_SETFL, O_NONBLOCK); fcntl(socket_data->sd, F_SETFL, O_NONBLOCK);
......
...@@ -33,6 +33,9 @@ static gboolean refresh_message_list = TRUE; ...@@ -33,6 +33,9 @@ static gboolean refresh_message_list = TRUE;
static gboolean filters_changed = FALSE; static gboolean filters_changed = FALSE;
static gboolean operation_running = FALSE; static gboolean operation_running = FALSE;
static const char *ui_ip;
static uint16_t ui_port;
gboolean ui_callback_on_open_messages(GtkWidget *widget, gpointer data) gboolean ui_callback_on_open_messages(GtkWidget *widget, gpointer data)
{ {
gboolean refresh = (data != NULL) ? TRUE : FALSE; gboolean refresh = (data != NULL) ? TRUE : FALSE;
...@@ -551,6 +554,7 @@ gboolean ui_pipe_callback(gint source, gpointer user_data) ...@@ -551,6 +554,7 @@ gboolean ui_pipe_callback(gint source, gpointer user_data)
return ui_handle_socket_connection_lost (source); return ui_handle_socket_connection_lost (source);
case UI_PIPE_XML_DEFINITION: case UI_PIPE_XML_DEFINITION:
ui_set_title ("%s:%d", ui_ip, ui_port);
return ui_handle_socket_xml_definition (source, input_data, input_data_length); return ui_handle_socket_xml_definition (source, input_data, input_data_length);
case UI_PIPE_UPDATE_SIGNAL_LIST: case UI_PIPE_UPDATE_SIGNAL_LIST:
...@@ -565,25 +569,23 @@ gboolean ui_pipe_callback(gint source, gpointer user_data) ...@@ -565,25 +569,23 @@ gboolean ui_pipe_callback(gint source, gpointer user_data)
gboolean ui_callback_on_connect(GtkWidget *widget, gpointer data) gboolean ui_callback_on_connect(GtkWidget *widget, gpointer data)
{ {
/* We have to retrieve the ip address and port of remote host */ /* We have to retrieve the ip address and ui_port of remote host */
const char *ip;
uint16_t port;
int pipe_fd[2]; int pipe_fd[2];
port = atoi (gtk_entry_get_text (GTK_ENTRY(ui_main_data.port_entry))); ui_port = atoi (gtk_entry_get_text (GTK_ENTRY(ui_main_data.port_entry)));
ip = gtk_entry_get_text (GTK_ENTRY(ui_main_data.ip_entry)); ui_ip = gtk_entry_get_text (GTK_ENTRY(ui_main_data.ip_entry));
g_message("Connect event occurred to %s:%d", ip, port); g_message("Connect event occurred to %s:%d", ui_ip, ui_port);
if (strlen (ip) == 0) if (strlen (ui_ip) == 0)
{ {
ui_notification_dialog (GTK_MESSAGE_ERROR, FALSE, "Connect", "Empty host ip address"); ui_notification_dialog (GTK_MESSAGE_ERROR, FALSE, "Connect", "Empty host ip address");
return FALSE; return FALSE;
} }
if (port == 0) if (ui_port == 0)
{ {
ui_notification_dialog (GTK_MESSAGE_ERROR, FALSE, "Connect", "Invalid host port value"); ui_notification_dialog (GTK_MESSAGE_ERROR, FALSE, "Connect", "Invalid host ui_port value");
return FALSE; return FALSE;
} }
...@@ -601,7 +603,9 @@ gboolean ui_callback_on_connect(GtkWidget *widget, gpointer data) ...@@ -601,7 +603,9 @@ gboolean ui_callback_on_connect(GtkWidget *widget, gpointer data)
ui_callback_signal_clear_list (widget, data); ui_callback_signal_clear_list (widget, data);
if (socket_connect_to_remote_host (ip, port, pipe_fd[1]) != 0) ui_set_title ("connecting to %s:%d ...", ui_ip, ui_port);
if (socket_connect_to_remote_host (ui_ip, ui_port, pipe_fd[1]) != 0)
{ {
ui_enable_connect_button (); ui_enable_connect_button ();
operation_running = FALSE; operation_running = FALSE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment