I'm not sure what you want demonstrated with example code, but I'll try and explain in different terms.
The input "Remote Port or Service Name" can take two inputs, an integer, or a string. When given a number, this is the
TCP/IP Port on which to operate. So if you want to send/receive data on port 21 (commonly used for
FTP), you would wire a numeric constant with the value of 21 to that input.
If you provide a string input, LabVIEW will query the
Service Locator and try and resolve your input to an existing service (which will correspond in turn to a port number). In reality, you can avoid using the Service Locator portion of this input, providing you already know which port you need to use.
I'm pretty sure NI has some examples provided in the TCP/UDP sections of their examples (go to Help->Find Examples, you can search for "TCP"), and they're usually pretty helpful.