\section{socket\_\-connect.c File Reference}
\label{socket__connect_8c}\index{socket_connect.c@{socket\_\-connect.c}}
{\tt \#include $<$netinet/in.h$>$}\par
{\tt \#include $<$netdb.h$>$}\par
{\tt \#include $<$sys/types.h$>$}\par
{\tt \#include $<$sys/socket.h$>$}\par
{\tt \#include $<$arpa/inet.h$>$}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
int {\bf socket\_\-connect} (char $\ast$host, int port)
\begin{CompactList}\small\item\em Connect a TCP-stream to a server (Client side).\item\end{CompactList}\end{CompactItemize}


\subsection{Function Documentation}
\index{socket_connect.c@{socket\_\-connect.c}!socket_connect@{socket\_\-connect}}
\index{socket_connect@{socket\_\-connect}!socket_connect.c@{socket\_\-connect.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int socket\_\-connect (char $\ast$ {\em host}, int {\em port})}\label{socket__connect_8c_a0}


Connect a TCP-stream to a server (Client side).

Creates a socket and connect it over a TCP-stream to the specified port on the specified server.\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
host}]a string (char $\ast$) which specifies the name or the IP-address of the server.\item[{\em 
port}]an integer which specifies the port on the server.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
The File Descriptor (FD) which allows access to the TCP-stream-socket or -1 if the connection fails. \end{Desc}
