|
| iMatix home page | << | < | > | >> |
SFLVersion 2.11 |
#include "sflsock.h"
sock_t
connect_TCP (
const char *host, /* Host name */
const char *service /* Service name */
)
Creates a TCP socket and connects it to a specified host and service. Returns a socket number or INVALID_SOCKET. In that case you can get the reason for the error by calling connect error (). This may be:
| IP NOSOCKETS | Sockets not supported on this system |
| IP BADHOST | Host is not known |
| IP BADPROTOCOL | Cannot understand protocol name |
| IP SOCKETERROR | Cannot open a socket |
| IP CONNECTERROR | Cannot connect socket |
sock_t handle;
handle = connect_TCP ("", "8080");
handle = connect_TCP (NULL, "echo");
handle = connect_TCP ("www.imatix.com", "http");
{
ASSERT (service && *service);
return (connect socket (host, /* We have a host name */
service, /* We have a service name */
"tcp", /* Protocol is TCP */
NULL, /* No prepared address */
3, 0)); /* 3 retries, no waiting */
}
| | << | < | > | >> |
|