External Exam Download Resources Web Applications Games Recycle Bin

TcpServer.h

--------------------------------
TcpServer Class Declaration File
--------------------------------*/

#ifndef _TCPSERVER_H
#define _TCPSERVER_H

#include "stdafx.h"
#include "RestaurantInformation.h"

using namespace System;
using namespace System::IO;  //for StreamWriter and StreamReader Classes, etc.
using namespace System::Net;  //for protocol-related classes.
using namespace System::Net::Sockets;  //for managed implementation of Winsock interface.
using namespace System::Threading;  //for thread management.

/***********************************************************************
TcpServer Class: used to manage client processes for reservation server.
See implementation file for description of each thread / function.
************************************************************************/
ref class TcpServer
{	
	private:
		//structures:
		value struct dissected {int seats; String^ who; int sitting;};
		//variables:
		Restaurant^ christmaslunch;
		//functions:
		dissected dissect_msg_string(String^);
		void requestPlaces(StreamWriter^);
		void makeBooking(StreamWriter^, String^);
		void cancelBooking(StreamWriter^, String^);
	
	public:
		//constructor:
		TcpServer();
		//destructor:
		~TcpServer();
		//threads:
		void ProcessThread(Object^);
		void redisplayBookingsEverySixtySeconds();
};

#endif