connection.c
changeset 29 7abf6146898e
parent 27 81a574d60c15
child 48 b94d657a9acb
equal deleted inserted replaced
28:54addf5893ef 29:7abf6146898e
    13 #include <arpa/inet.h>
    13 #include <arpa/inet.h>
    14 
    14 
    15 int connection (char *ip, unsigned short port)
    15 int connection (char *ip, unsigned short port)
    16 {
    16 {
    17     struct hostent *hs;
    17     struct hostent *hs;
    18 
       
    19     struct sockaddr_in sock;
    18     struct sockaddr_in sock;
    20 
    19 
    21     int sockfd;
    20     int sockfd;
    22 
    21 
    23     memset (&sock, 0, sizeof (sock));
    22     memset (&sock, 0, sizeof (sock));