LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

About the GetHostTCPSocketHandle() function

Hello,

 

I'd like to know if the 2nd parameter of the function is corresponding to the "SOCKET" type in the Windows SDK? Can you tell me the usage of this function? Thanks.

 

 

David

0 Kudos
Message 1 of 4
(3,390 Views)

Phototype:

 

int GetHostTCPSocketHandle(unsigned int Connection_Handle,int *Socket_Handle);

 

Connection_Handle: TCP Support Library conversation handle that you obtain from ConnectToTCPServer or ConnectToTCPServerEx or receive in a server callback as the handle parameter of a TCP_CONNECT message.

 

*Socket_Handle: System socket handle for the connection that connectionHandle identifies. (passed by reference);

 

Status: Return value indicating whether the function was successful. Unless otherwise stated, zero represents successful execution and a negative number represents the error code.

You can call the GetTCPSystemErrorString function to obtain a system message that describes the error. The system messages can be more descriptive than the TCP Support Library error codes. To obtain the correct system error message, you must call GetTCPSystemErrorString immediately after calling the TCP Support Library function that failed.

For functions that read or write data (ClientTCPRead, ClientTCPWrite, ServerTCPRead, ServerTCPWrite), if the function was successful, the return value is the number of bytes transferred.

You can have a maximum of 255 concurrent conversations and up to 1,024 connections. If you exceed this limit, -kTCP_TooManyConnections will be returned. You may not be able to open the maximum number of connections allowed by LabWindows/CVI because of limitations imposed by the operating system.

 

 

0 Kudos
Message 2 of 4
(3,383 Views)

Hi,

 

Can I recognize the parameter 'intptr_t **socketHandle' as the SOCKET type which in the SDK?

 

 

David

0 Kudos
Message 3 of 4
(3,378 Views)

Yes.

0 Kudos
Message 4 of 4
(3,365 Views)