partly done udp stuff and fixed version of tcp-thread