Develop and Download Open Source Software

Browse Subversion Repository

Contents of /connection/SocketSet.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 191 - (show annotations) (download) (as text)
Fri Jan 4 02:49:36 2008 UTC (16 years, 3 months ago) by satofumi
File MIME type: text/x-chdr
File size: 1199 byte(s)
using namespace beego

1 #ifndef SOCKET_SET_H
2 #define SOCKET_SET_H
3
4 /*!
5 \file
6 \brief 通信ソケット管理
7
8 \author Satofumi KAMIMURA
9
10 $Id$
11 */
12
13 #ifdef HAVE_CONFIG_H
14 #include "config.h"
15 #endif
16 #if !HAVE_CONFIG_H || HAVE_LIBSDL_NET
17 #include <SDL_net.h>
18 #else
19 class TCPsocket;
20 #endif
21 #include <memory>
22
23 namespace beego {
24
25 class TcpipCtrl;
26
27
28 /*!
29 \brief 通信ソケット管理
30 */
31 class SocketSet {
32 SocketSet(const SocketSet& rhs);
33 SocketSet& operator = (const SocketSet& rhs);
34
35 struct pImpl;
36 const std::auto_ptr<pImpl> pimpl;
37
38 public:
39 /*!
40 \brief コンストラクタ
41
42 \param size [i] 初期状態でのソケット許容数
43 */
44 explicit SocketSet(size_t size = 1);
45 ~SocketSet(void);
46
47 /*!
48 \brief ソケットの登録
49
50 \param socket [i] 登録するソケット
51
52 \retval true 登録に成功
53 \retval false 登録に失敗
54 */
55 bool add(TCPsocket socket);
56
57 /*!
58 \brief ソケットの削除
59
60 \param socket [i] 削除するソケット
61 */
62 void del(TCPsocket socket);
63
64 /*!
65 \brief 受信データがあるかの確認
66
67 \param timeout [i] タイムアウト時間 [msec]
68
69 \return 受信データのあるソケット数
70 */
71 size_t check(int timeout);
72 };
73 };
74
75 #endif /* !SOCKET_SET_H */

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26