Made it possible to access UDP-socket in order to trap errors. Added test to verify trapping works.