IP_ConnectToPort

Cogent API and Utilities: Version 4.1
Prev |  | Next

# `IP_ConnectToPort`

`IP_ConnectToPort` -- resolves a host name and connects to a port.

## Syntax

``int IP_ConnectToPort`(char* host, int port);`

## Arguments

`host`

  A host name.

`port`

  A port number.

## Returns

A file descriptor (socket) on success, or `-1` on failure and `errno` is set.

## Description

This function resolves the host name, which may be either a fully qualified host name or an IP address as an ASCII string containing a dotted quad. It then attempts to connect to the specified port on that host.

## See Also

Working with TCP/IP, `IP_ListenToService`, `IP_ConnectToService`

Prev | Home | Next
`IP_AttachPhotonMainloop` | Up | `IP_ConnectToService`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.