VARKON Version 1.17D 2003-03-25


 
 

tcp_invec - function

 

Description

Receive vector from specified socket connection. A parameter can be used to specify conversion between 32/64 bit floats. This function is equivalent to 3 succesive calls to TCP_infloat.
 

Syntax

tcp_invec(socket, bytecount, byteorder, timeout, data);
 
INT socket
INT bytecount
INT byteorder
FLOAT timeout
FLOAT data
 

Principal parameters

socket - id of the socket connection to receive data from.
bytecount - The number of bytes to be read. The only valid values are 4 and 8. Varkon float is 8 byte.
byteorder - if = 1 conversion is made from network to local byteorder. 0 = no conversion.
timeout - Time to wait for incomming data.
data - A variable to retrieve the data to be read.
 

Optional parameters

none
 

Return value

An INT value equal to the current error status as below:
24 = Operation was successful, 24 bytes received (3 x 8).
12 = Operation was successful, 12 bytes received (3 x 4).
-1 = Timeout value is expired.
-2 = The descriptor is not a socket or the socket is not connected.
-3 = The network subsystem or the associated service provider has failed.
-20 = Winsock routine select() failed before receiving.
-21 = Winsock routine receive() failed.
-22 = The virtual circuit was reset by the remote side executing a "hard" or "abortive" close.
-23 = The connection has been dropped because of a network failure or because the system on the other end went down without notice.
 
 

Comments

Conversion from network to local byteorder is only possible for 4-byte floats.
 

See also

tcp_connect()     tcp_listen()     tcp_close()     tcp_outint()     tcp_inint()     tcp_infloat()     tcp_outfloat()     tcp_outvec()     tcp_getlocal()     tcp_getremote()    
 

VARKON Homepage Index