here i using 'if' is because some times i need test both tcp and udp.