.\" @(#)isc_opentcp.3x 1.0 92/02/03 Lysator .\" ISC - networking library .\" Copyright (C) 1992, 1999 by Peter Eriksson and Per Cederqvist of the .\" Lysator Academic Computer Association. .\" .\" .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. .\" .TH ISC_OPENTCP 3X "3 February 1992" "Release 1.0" "ISC LIBRARY" .SH NAME isc_opentcp \- open a TCP/IP connection and associate it with an ISC session .SH SYNOPSIS .nf .ft B #include .ft .fi .LP .nf .ft B IscSession *isc_opentcp(IscMaster *mcb, const char *host, const char *service) .ft R .fi .SH DESCRIPTION .IX "isc_opentcp()" "" "\fLisc_opentcp()\fP function" .LP .B isc_opentcp(\|) opens a new TCP/IP connection to a remote service. The session is inserted into the master control structure specified. .LP The .I mcb argument must point to a previously allocated master structure as returned by the .B isc_initialize(\|) function call. .LP The .I host argument can either be NULL for a local connection or a null terminated string containing either a domain name or an IP number in decimal notation. .LP The .I service argument is a null termnated string containing either a port number or a service name as specified by the .BR /etc/services file. .SH RETURN VALUES .LP .B isc_opentcp(\|) returns a non-\s-1NULL\s0 pointer to a session value suitable for use with subsequent .SM ISC functions calls. On failure, it returns .SM NULL and no memory is allocated and no connection is initiated. .br .ne 6 .SH FILES .PD 0 .TP 20 .B /etc/services .TP .B /etc/hosts .PD .SH "SEE ALSO" .BR isc (3x) .BR isc_initialize (3x) .BR isc_shutdown (3x) .BR isc_listentcp (3x) .BR isc_unlisten (3x) .BR isc_openfile (3x) .BR isc_openfd (3x) .BR isc_close (3x) .BR isc_enable (3x) .BR isc_disable (3x) .BR isc_sessions (3x) .BR isc_getnextevent (3x) .BR isc_dispose (3x) .BR isc_flush (3x) .BR isc_write (3x) .BR isc_putc (3x) .BR isc_printf (3x)