connect.h 603 Bytes
Newer Older
Matthew Burket's avatar
Matthew Burket committed
1 2 3 4 5 6 7 8 9 10 11 12 13
//
// Created by mburket on 3/29/18.
//

#ifndef COMS352_PROJECT2_PART1_CONNECT_H
#define COMS352_PROJECT2_PART1_CONNECT_H

#include <netdb.h>
#include <unistd.h>
#include <memory.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
14 15 16
#include "buffer.h"

#define RECV_SIZE 1024
Matthew Burket's avatar
Matthew Burket committed
17 18 19

void init_connection(char *hostname, int port, struct addrinfo **info);
int establish_connect(struct addrinfo *info);
20
int execate_request(int socketfd, char *hostname, char *path, int head, int date, char *date_string);
Matthew Burket's avatar
Matthew Burket committed
21
int get_result(int socketfd, GrowthBuffer *recvBuff);
Matthew Burket's avatar
Matthew Burket committed
22 23

#endif //COMS352_PROJECT2_PART1_CONNECT_H