first commit
This commit is contained in:
51
include/modules/io_net/io_net_server_thread.h
Normal file
51
include/modules/io_net/io_net_server_thread.h
Normal file
@ -0,0 +1,51 @@
|
||||
/* -----------------------------------------------------------------------------
|
||||
GSFramework
|
||||
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
|
||||
----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
#ifndef __NIONETSERVERTHREAD__
|
||||
#define __NIONETSERVERTHREAD__
|
||||
|
||||
|
||||
#include "io_net/io_net_server.h"
|
||||
#include "thread/mutex.h"
|
||||
#include "thread/thread.h"
|
||||
#include "thread/atomic_value.h"
|
||||
#include "filesystem/io_base.h"
|
||||
#include "memory/nshared_ptr.h"
|
||||
#include "nstring/nstring.h"
|
||||
|
||||
|
||||
namespace GS {
|
||||
namespace IO {
|
||||
|
||||
//
|
||||
class NetServerThread : public Threading::Thread
|
||||
{
|
||||
String ip;
|
||||
int port;
|
||||
|
||||
SharedPtr <Base> basefs;
|
||||
Threading::Atomic32 state;
|
||||
|
||||
Threading::Mutex server_mutex;
|
||||
AutoPtr <NetServer> server;
|
||||
|
||||
public:
|
||||
|
||||
void GetStatistics(NetServer::Statistics &);
|
||||
|
||||
void Execute();
|
||||
bool Start(const char *ip, int port);
|
||||
void Stop();
|
||||
|
||||
NetServerThread(Base *fs) : basefs(fs) {}
|
||||
~NetServerThread();
|
||||
};
|
||||
|
||||
} // IO
|
||||
} // GS
|
||||
|
||||
|
||||
#endif // __NIONETSERVERTHREAD__
|
||||
Reference in New Issue
Block a user