/* A simple server in the internet domain using TCP
The port number is passed as an argument */
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
void error ( char * msg )
{
perror ( msg ) ; exit ( 1 ) ;
}
int main ( int argc , char * argv [ ] )
{
int sockfd , newsockfd , portno , clilen ;
char buffer [ 256 ] ;
struct sockaddr_in serv_addr , cli_addr ;
int n ;
if ( argc < 2 ) { fprintf ( stderr , "ERROR, no port provided \n " ) ;