fix crash when using udp

Signed-off-by: dannygod <dannygodii@gmail.com>