Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef DISCORD_CLIENT_H
- #define DISCORD_CLIENT_H
- #pragma once
- #include <iostream> /* std::cout, std::cerr, std::endl */
- #include <string> /* std::string */
- #include <functional>
- #include <map>
- #include <vector>
- #include <cstdlib> /* exit */
- #include <cstdio> /* perror */
- #include <cstring> /* memcpy, memset */
- #ifdef _WIN32
- #include <process.h>
- #include "AllowWindowsPlatformTypes.h"
- #include <winsock2.h>
- #include "HideWindowsPlatformTypes.h"
- #else
- #include <sys/socket.h>
- #include <sys/types.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <netdb.h>
- #include <unistd.h>
- #endif
- using namespace std;
- class Discord_Client {
- public:
- Discord_Client(int PORT, char *HOST);
- ~Discord_Client();
- void discord_connect();
- void discord_disconnect();
- string discord_get(string msg);
- void discord_send(const char *msg);
- private:
- static const int MAX_LINE = 1024;
- int PORT;
- char *HOST;
- #ifdef _WIN32
- SOCKET sockfd;
- #else
- pthread_t thread;
- int sockfd;
- #endif
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement