try with sleep after socket close.