+static void __clear_disconnect_socket(port_list_info_s *port_info)
+{
+ GError *error = NULL;
+
+ if (port_info == NULL)
+ return;
+ _LOGI("__clear_disconnect_socket : fd [%d]", port_info->send_sock_fd);
+
+ if (port_info->gio_read != NULL) {
+ g_io_channel_shutdown(port_info->gio_read, TRUE, &error);
+ if (error) {
+ _LOGE("g_io_channel_shutdown error : %s", error->message);
+ g_error_free(error);
+ }
+ g_io_channel_unref(port_info->gio_read);
+ port_info->gio_read = NULL;
+ }
+
+ if (port_info->g_src_id != 0) {
+ g_source_remove(port_info->g_src_id);
+ port_info->g_src_id = 0;
+ }
+ port_info->send_sock_fd = 0;
+}
+
+static gboolean __socket_disconnect_handler(GIOChannel *gio,
+ GIOCondition cond,
+ gpointer data)
+{
+ /* It's sender socket's gio channel so, only EOF can be received */
+ port_list_info_s *port_info = (port_list_info_s *)data;
+ _LOGI("__socket_disconnect_handler %d", cond);
+ __clear_disconnect_socket(port_info);
+ return FALSE;
+}
+