From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

wrong remote port number with TCP listener

Hi
I am sending data from a dsp with a network card over TCP/IP to my pc running labview7express. The data is received correctly, I use a 'TCP create listener' followed by a 'TCP wait on listener' to establish the connection, followed by a while loop with 'TCP read' in it.
The port returned by 'TCP create listener' is correct (1001), but somehow 'TCP wait on listener' returns 57345 as remote port!?
Also when using another port eg 1003 it still returns 57345..
Anyone knows how this erroneous portnumber is achieved?
0 Kudos
Message 1 of 3
(2,688 Views)
ok ignore this q, I thought I was setting the remote port but I am not, 57345 is automatically chosen by the network card.
0 Kudos
Message 2 of 3
(2,688 Views)
stino wrote:

> Hi
> I am sending data from a dsp with a network card over TCP/IP to my pc
> running labview7express. The data is received correctly, I use a 'TCP
> create listener' followed by a 'TCP wait on listener' to establish the
> connection, followed by a while loop with 'TCP read' in it.
> The port returned by 'TCP create listener' is correct (1001), but
> somehow 'TCP wait on listener' returns 57345 as remote port!?
> Also when using another port eg 1003 it still returns 57345..
> Anyone knows how this erroneous portnumber is achieved?

Nothing wrong with that. A TCP/IP connection has ALWAYS two connection
ends with each of them using a port number. 1001 is the port of the
local listen socket (which needs to be fixed so that clients can connect
to a know
n server) in your LabVIEW application. 57345 is the port number
used by your software running on your DSP board. A client usually has no
fixed port number but allocates any port number not already in use. When
the listen socket receives a connection request it connects and passes
the connection with the local port 1001 and the remote port 57345
through TCP Wait On Listener to your application. Since you set up the
Listen Socket in Create Listener you already know its port number so TCP
Wait on Listener does only return the port number of the remote
connection end of your connection.

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 3
(2,688 Views)