Socket Functions (TutSocket*)


The TutSocket* functions are used to work with sockets on a low level. These routines can be useful if you are trying to mix SmartSockets connections and sockets.

TutSocketAccept — accept socket connection from client

T_INT4 TutSocketAccept(server_fd) 
T_INT4 server_fd; 

TutSocketCheck — check whether data can be read from or written to socket

T_BOOL TutSocketCheck(socket_fd, check_mode, timeout) 
T_INT4 socket_fd; 
T_IO_CHECK_MODE check_mode; 
T_REAL8 timeout; 

TutSocketCreateClientLocal — create the client side of a local socket

T_INT4 TutSocketCreateClientLocal(file_name) 
T_STR file_name; 

TutSocketCreateClientTcp — create the client side of a TCP/IP socket

T_INT4 TutSocketCreateClientTcp(node_name, port_num) 
T_STR node_name; 
T_INT4 port_num; 

TutSocketCreateServerLocal — create the server side of a local socket

T_INT4 TutSocketCreateServerLocal(file_name) 
T_STR file_name; 

TutSocketCreateServerTcp — create the server side of a TCP/IP socket

T_INT4 TutSocketCreateServerTcp(port_num) 
T_INT4 port_num; 

TutSocketGetBlockMode — determine the block mode of a socket

T_BOOL TutSocketGetBlockMode(socket_fd, block_mode_return) 
T_INT4 socket_fd; 
T_BOOL *block_mode_return; 

TutSocketRecvAll — read multiple times from a socket until all data is received

T_INT4 TutSocketRecvAll(fd, buf, size, flags) 
T_INT4 fd; 
T_PTR buf; 
T_INT4 size; 
T_INT4 flags; 

TutSocketRecvTimeout — read data from a socket with a timeout

T_INT4 TutSocketRecvTimeout(socket_fd, buf, size, flags, timeout, 
timeout_reached_return) 
T_INT4 socket_fd; 
T_PTR buf; 
T_INT4 size; 
T_INT4 flags; 
T_REAL8 timeout; 
T_BOOL *timeout_reached_return; 

TutSocketSetBlockMode — set the block mode of a socket

T_BOOL TutSocketSetBlockMode(socket_fd, block_mode) 
T_INT4 socket_fd; 
T_BOOL block_mode; 

TIBCO SmartSockets™ API Quick Reference
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com