Do you have to close the socket here?

I guess your data sent are small and the server is quick enough. Otherwise, the client might need to evolve into a non-blocking breed; I however have no idea what non-blocking UDP clients would be like.