Add UDP / TCP choice

the function SelectProtocol has some problem while linking...