////////////////////////////////////////////////////////////
//
//     	Declaration of a class
//	ASocketMonitor
//
//      Copyright 2002 
//
////////////////////////////////////////////////////////////

#ifndef __ASOCKETMONITOR_H__
#define __ASOCKETMONITOR_H__

#include <sys/time.h>
#include "ASocket.h"

	// ASocketMonitor
	
class ASocketMonitor
{
public:

ASocketMonitor();
~ASocketMonitor(){}

int add_send(ASocket& );
int add_receive(ASocket& );
int add_accept(ASocket& );
int add_error(ASocket& );
int remove(ASocket& );

// blocks until an event or timeout
int monitor(int& number,unsigned timeout_milliseconds);

private:
	fd_set read_set,write_set,error_set;
	int max_handle;
};


#endif