status.i4.v = tcp_connect_by_handle(tcp_host.i1a.r, tcp_port.i4.v,
This routine establishes a communication path for you to send or
receive messages from a TCP server.
tcp_host name of the host with the server you wish to connect to
(i.e. centra, clx40, etc.)
tcp_port port number of the server you wish to connect to
handle returned handle value which can then be passed
to the tcp_disconnect, tcp_receive, and tcp_send
[message_func] address of AST routine to be called when you receive
a message from the server. If not specified, it's
up to you to check for messages with tcp_receive.
host and port are passed to this AST routine.
The host and port are passed to this function.
(default is NULL)
This function returns ACNET status values as follows:
CBS_NO_SUCH no such host name
CBS_BUGCHECK unable to open a socket
CBS_NOTOPN unable to connect to socket
This function requires the following include files:
cnsparam_h, cbslib_h, acnet_errors_h
tcp_disconnect_by_handle, tcp_receive_by_handle, tcp_send_by_handle,
tcp_connect, tcp_disconnect, tcp_receive, tcp_send, tcp_send_wait
static const char tcp_host = "centra";
int tcp_port = 4353;
void message_func(char *host, int port);
status = tcp_connect_by_handle(tcp_host,tcp_port,&handle,message_func);