Adding some usefull functions

Adding function create_socket and duration to UDP prog