Put declarations to the beginning of blocks before comments.
Make laddr a global variable.
In non-connected mode use multiple sockets bound to different ports.