At this project you can see usage of tcp and udp sockets communications