-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSocket.h
More file actions
55 lines (47 loc) · 1005 Bytes
/
Socket.h
File metadata and controls
55 lines (47 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// main.cpp
// Program5
//
// Created by Artem Kovtunenko on 3/2/16.
// Copyright (c) 2016 432. All rights reserved.
//
#ifndef SocketCS_Socket_h
#define SocketCS_Socket_h
#include <fstream>
#include <sstream>
#include <sys/poll.h>
#include <iostream>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <string.h>
#include <netdb.h>
#include <netinet/tcp.h>
#include <sys/uio.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/poll.h>
#include <iostream>
using namespace std;
class Socket
{
private:
int clientSD;
public:
Socket();
~Socket();
int openCientSocket(const char*, int);
int pollRecvFrom(int);
void closeSD();
void shutDownSD();
int writeTo(char *, int);
int readFrom(char *, int);
void readBuffer(char *, int);
void readData(ostream&);
//int sendTo(char msg[], int length);
//int recvFrom(char msg[], int length);
};
#endif