Use MSG_DONTWAIT flag
This patch uses MSG_DONTWAIT flag instead of socket existence check.
If calling the send() function returns an error with the errno value
that is EAGAIN or EWOULDBLOCK, the method will call the sleep() and try
to send the data again.
The interval is 2ms. The maximum retry count is 10.
If the retry count exceeds 10 times, AMD will close the file descriptor
to disconnect the connection. When handling the disconnected event,
AMD doesn't invoke the disconnected event callback function if the
client socket is closed. It means the connection is closed by AMD forcedly.
Change-Id: I8217d889506d82418c271d79491817634b33e32d
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>