summaryrefslogtreecommitdiff
path: root/gdhcp/client.c
diff options
context:
space:
mode:
authorNishant Chaprana <n.chaprana@samsung.com>2020-10-12 14:42:00 +0530
committerNishant Chaprana <n.chaprana@samsung.com>2020-10-12 17:33:10 +0530
commitd56fb241d6eb569acd54848d83d20d5bda3cf3cc (patch)
tree05395014a72346e981b904408c9a95c1a6266ae2 /gdhcp/client.c
parent2ff3cf0e89bbdc19bc261000526562f684b29554 (diff)
downloadconnman-d56fb241d6eb569acd54848d83d20d5bda3cf3cc.tar.gz
connman-d56fb241d6eb569acd54848d83d20d5bda3cf3cc.tar.bz2
connman-d56fb241d6eb569acd54848d83d20d5bda3cf3cc.zip
[gdhcp/client] Reopen socket GIO channel when failed
Change-Id: Ib63b6f194e67fc4d7cfc3f223afa064761dff578 Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
Diffstat (limited to 'gdhcp/client.c')
-rwxr-xr-xgdhcp/client.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdhcp/client.c b/gdhcp/client.c
index 22bbc8e2..2bdc6163 100755
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -2324,6 +2324,14 @@ static gboolean listener_event(GIOChannel *channel, GIOCondition condition,
if (condition & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) {
dhcp_client->listener_watch = 0;
+#if defined TIZEN_EXT
+ /* re-register event listener when socket failed */
+ int retry_count = 0;
+ int ret = -1;
+ while (retry_count++ < GIO_SOCKET_RETRY_COUNT && ret < 0)
+ ret = switch_listening_mode(dhcp_client,
+ dhcp_client->type);
+#endif /* defined TIZEN_EXT */
return FALSE;
}