Some code written for the TCP part.