![]() |
remote port or service name
I was looking into a TCP connection, and can understand everything except for the remote port or service name. What am i supposed to put there? does it not matter as long as it is the same? do they have to be different?
|
Re: remote port or service name
If you think of the IP address as the street address, the port is like the apartment or door number. For a given machine they need to match, but if they use the term outgoing port, that refers the sending computer's port.
Service names are a way of using names and letting the port number be dynamically assigned. Quite a few port numbers are reserved for a given service. It is worth reading Wikipedia on tcp/ip to get a better sense of which to use. In LV, an unwired port will be dynamically assigned to avoid a conflict and is typically the right thing for outgoing ports Greg McKaskle |
Re: remote port or service name
can you post example code please?
|
Re: remote port or service name
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. |
Re: remote port or service name
so the port can be any number than, as long as it matches the other computer's?
|
Re: remote port or service name
There are ranges of ports that are reserved, and some low numbered ones that are owned by things like ftp. But yes. Use the same number for both, as the examples do, and it should work.
Greg McKaskle |
Re: remote port or service name
what number would you say is the lowest i could do (or any safe one)
|
Re: remote port or service name
Ports that are guaranteed open on the field (from the manual):
Quote:
|
Re: remote port or service name
i want to get a picture from the camera by an onboard laptop, do some processing, and then send information out to the crio to read. So not dealing with any network. So is it still limited?
|
Re: remote port or service name
Quote:
|
Re: remote port or service name
udp not tcp?
|
Re: remote port or service name
If you're just sending data between two computers, you don't need the handshake because, if a packet is dropped, another one will be sent very shortly thereafter. It's the same reason the driver station/robot communication uses UDP, as well.
|
Re: remote port or service name
oh ok so TCP is only for if you need to send data making sure that it arrives correctly with no error. For example, a messaging program, right? But since it will be updating information constantly, it doesn't matter if it gets there or not, because right after it a new one will come in. Is this right?
|
Re: remote port or service name
That is correct.
|
Re: remote port or service name
ok thank you so much. I think i understand it now. +1 for reputation :)
|
| All times are GMT -5. The time now is 10:53. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi