James (if you are still interested)
Yes,
if you use the callback data you can transmit the port request, the documentation is a little confusing but it is in there(sort of , :):):) ...),
example (assume PortNum[] is an array of ports declared on the server:
regstat = RegisterTCPServer (PortNum[0], ServerTCPCB, (void*)PortNum[0]);
;;
on the client
regstat = ConnectToTCPServer (&tcpHandle[0], PortNum[0], tempBuf, ClientTCPCB, NULL, 5000);
and on the server pass the port number
int CVICALLBACK ServerTCPCB (unsigned handle, int event, int error,
void *callbackData)
{
..
switch (event)
{
case TCP_CONNECT:
if (handle == tcpHandle[0])
{
/* We already have one client, don't accept another... */
}
if (handle == tcpHandle[1])
{
} }
if (handle == tcpHandle[2])
{
} }
else
{
/* Handle this new client connection */
if ((int)callbackData == PortNum[0])
{
tcpHandle[0] = handle;
.......//
Demo code is attached in the zip file.
I tested it on three computers
one client (port1) was an NT4.0 machine with CVI 5.0
two client instances (ports 1 & 2) ran on XP under CVI 5.5
and the server was W2KP with CVI 6.0
this works, the only issue is how to do handshaking to get real speed(and that is a big issue as far as I know) I haven't been able to test it over a WAN.
hope this helps.
The example code has a lot of other stuff in it for testing (Sorry about that, time yo
u know....)
CMM.