⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 server_i.h

📁 这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用于网络游戏医学图像网关的高qos要求.更详细的内容可阅读相应的材料
💻 H
字号:
// Server_i.h,v 1.3 2003/08/19 15:08:26 schmidt Exp

#ifndef SERVER_H
#define SERVER_H

#include "ace/Acceptor.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "ace/SOCK_Acceptor.h"
#include "Handler.h"

/* Anytime I have templates I try to remember to create a typedef for
   the parameterized object.  It makes for much less typing later!
*/
typedef ACE_Acceptor <Handler, ACE_SOCK_ACCEPTOR> Acceptor;

class Server
{
public:
  // Our simple constructor takes no parameters.  To make the
  // server a bit more useful, you may want to pass in the
  // TCP/IP port to be used by the acceptor.
  Server (void);
  ~Server (void);

  // Open the server for business
  int open (void);

  // Close all server instances by setting the finished_ flag.
  // Actually, the way this class is written, you can only have
  // one instance.
  static int close (void);

  // Run the server's main loop.  The use of the gloabl ACE_Reactor by
  // this method is what limits us to one Server instance.
  int run (void);

private:
  // This will accept client connection requests and instantiate a
  // Handler object for each new connection.
  Acceptor acceptor_;

  // Our shutdown flag
  static sig_atomic_t finished_;
};

#endif /* SERVER_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -