summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2013-07-24 00:47:18 (GMT)
committerSung-jae Park <nicesj.park@samsung.com>2013-07-24 00:47:18 (GMT)
commit2bdbbfa0fff90324d24bcbaf7753f1309d2e119e (patch)
tree74c0c7f08fdb254c3f1cba3dec1cf163a3691200
parent022b3b3d454f190d501eaac5ecb9ada7f89136c6 (diff)
downloaddata-provider-master-2bdbbfa0fff90324d24bcbaf7753f1309d2e119e.zip
data-provider-master-2bdbbfa0fff90324d24bcbaf7753f1309d2e119e.tar.gz
data-provider-master-2bdbbfa0fff90324d24bcbaf7753f1309d2e119e.tar.bz2
Before send a packet, check the status of socket.
If it is unavailable, waiting 2 secs. Change-Id: I545891a7622de82282416d063a5a0f4bd95247e6
-rw-r--r--packaging/data-provider-master.spec2
-rw-r--r--src/event.c3
-rw-r--r--src/service_common.c12
3 files changed, 14 insertions, 3 deletions
diff --git a/packaging/data-provider-master.spec b/packaging/data-provider-master.spec
index 131cbfb..26017ad 100644
--- a/packaging/data-provider-master.spec
+++ b/packaging/data-provider-master.spec
@@ -1,6 +1,6 @@
Name: data-provider-master
Summary: Master service provider for liveboxes.
-Version: 0.24.21
+Version: 0.24.23
Release: 1
Group: HomeTF/Livebox
License: Flora License
diff --git a/src/event.c b/src/event.c
index d6dd920..fee98b4 100644
--- a/src/event.c
+++ b/src/event.c
@@ -122,6 +122,9 @@ static inline int processing_input_event(struct input_event *event)
ErrPrint("Unable to send an event: %s\n", strerror(errno));
return LB_STATUS_ERROR_IO;
}
+
+ /* Take a breathe */
+ pthread_yield();
}
break;
case SYN_CONFIG:
diff --git a/src/service_common.c b/src/service_common.c
index 27ab295..d240bed 100644
--- a/src/service_common.c
+++ b/src/service_common.c
@@ -27,6 +27,7 @@
#include <dlog.h>
#include <Eina.h>
+#include <com-core.h>
#include "service_common.h"
#include "util.h"
@@ -35,6 +36,7 @@
#define EVT_CH 'e'
#define EVT_END_CH 'x'
+#define DEFAULT_TIMEOUT 2.0f
int errno;
@@ -296,6 +298,9 @@ static void *client_packet_pump_main(void *data)
DbgPrint("Packet received: %d bytes\n", packet_offset);
recv_state = RECV_INIT;
}
+
+ /* Take a breathe */
+ pthread_yield();
}
}
@@ -601,6 +606,9 @@ static void *server_main(void *data)
packet_destroy(packet_info->packet);
free(packet_info);
}
+
+ /* Take a breathe */
+ pthread_yield();
}
processing_timer_event(svc_ctx, &set);
@@ -819,7 +827,7 @@ HAPI int service_common_unicast_packet(struct tcb *tcb, struct packet *packet)
}
DbgPrint("Unicast packet\n");
- return secure_socket_send(tcb->fd, (void *)packet_data(packet), packet_size(packet));
+ return com_core_send(tcb->fd, (void *)packet_data(packet), packet_size(packet), DEFAULT_TIMEOUT);
}
/*!
@@ -847,7 +855,7 @@ HAPI int service_common_multicast_packet(struct tcb *tcb, struct packet *packet,
continue;
}
- ret = secure_socket_send(target->fd, (void *)packet_data(packet), packet_size(packet));
+ ret = com_core_send(target->fd, (void *)packet_data(packet), packet_size(packet), DEFAULT_TIMEOUT);
if (ret < 0)
ErrPrint("Failed to send packet: %d\n", ret);
}