#pragma once

#include <iostream>
#include <cstdio>
#ifndef _NO_MORE_WINSOCK_
#include <winsock2.h>
#endif
#include <string>
#include <tchar.h>
#include <stdlib.h>
#include <stdio.h>

using namespace std;


class SmallSocket
{
public:
	const static int CLIENT = 0;
	const static int SERVER = 1;
	const static int BUFFER_SIZE = 1024;
	const static int PORT_NUMBER=2000;

	int socketType; 
	WSADATA wsaData;
	SOCKET m_socket;

	sockaddr_in service;  // for SERVER
	sockaddr_in clientService;  // for CLIENT

	int sendout(const char* buffer, int nchars=0);
	int receive(char* buffer, int nchars);
	void cfunction();
	SmallSocket(int socket_type);
	~SmallSocket(void);

	static char* getBuffer();
};
