From: Christian Finetto on 7 Jun 2010 05:31 Hello, I'm trying to connect my target PC to a server application using UDP. Basically the target application has to send a connection request to a given server port. The server will then open a new socket on the first free UDP port and respond with a data packet. Afterwards I need to send data to this new port. The following ports are static and given before I build the target application: - Server port where to send the connection request to - Local port where the target application receives the data packets On the other hand, the new server port is unknown until I connect. I've done the same thing using Matlab and the pnet library without problems. After I send the connection request I wait for the response and get the port number from the packet properties (I use [ServerIP,ServerPort]=pnet(socket,'gethost')). But I'm having the following issues using xPC-target: a) I don't know how to retrieve the server port from the received packet b) I don't know how to dynamically change the port number in the UDP Send block. Is there a way to do this? I've found an alternative solution, but it requires me to change the server application and to use static ports, and I'd like to avoid that. Thank you, Christian
|
Pages: 1 Prev: how to calculate area of a grayscale image? Next: matrix operations |