1 mike 1.1 //BEGIN_LICENSE
2 //
3 // Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a
6 // copy of this software and associated documentation files (the "Software"),
7 // to deal in the Software without restriction, including without limitation
8 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 // and/or sell copies of the Software, and to permit persons to whom the
10 // Software is furnished to do so, subject to the following conditions:
11 //
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
15 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18 // DEALINGS IN THE SOFTWARE.
19 //
20 //END_LICENSE
21 //BEGIN_HISTORY
22 mike 1.1 //
23 // Author: Michael E. Brasher
24 //
25 // $Log$
26 //
27 //END_HISTORY
28
29 #ifndef Pegasus_WindowsChannel_h
30 #define Pegasus_WindowsChannel_h
31
32 #include <Pegasus/Common/Config.h>
33 #include <Pegasus/Common/Channel.h>
34
35 PEGASUS_NAMESPACE_BEGIN
36
37 class PEGASUS_COMMON_LINKAGE WindowsChannel : public Channel
38 {
39 public:
40
41 WindowsChannel(Uint32 desc, ChannelHandler* handler);
42
43 mike 1.1 virtual ~WindowsChannel();
44
45 virtual Sint32 read(void* ptr, Uint32 size);
46
47 virtual Sint32 write(const void* ptr, Uint32 size);
48
49 virtual Sint32 readN(void* ptr, Uint32 size);
50
51 virtual Sint32 writeN(const void* ptr, Uint32 size);
52
53 virtual void enableBlocking();
54
55 virtual void disableBlocking();
56
57 virtual Boolean wouldBlock() const;
58
59 Boolean getBlocking() const { return _blocking; }
60
61 virtual Boolean handle(Sint32 desc, Uint32 reasons);
62
63 private:
64 mike 1.1 Sint32 _desc;
65 Boolean _blocking;
66 ChannelHandler* _handler;
67 };
68
69 class PEGASUS_COMMON_LINKAGE WindowsChannelConnector : public ChannelConnector
70 {
71 public:
72
73 WindowsChannelConnector(
74 ChannelHandlerFactory* factory,
75 Selector* selector);
76
77 virtual ~WindowsChannelConnector();
78
79 virtual Channel* connect(const char* address);
80
81 virtual void disconnect(Channel* channel);
82
83 private:
84 Selector* _selector;
85 mike 1.1 };
86
87 class PEGASUS_COMMON_LINKAGE WindowsChannelAcceptor : public ChannelAcceptor
88 {
89 public:
90
91 WindowsChannelAcceptor(ChannelHandlerFactory* factory);
92
93 virtual ~WindowsChannelAcceptor();
94
95 virtual void bind(const char* bindString);
96
97 virtual void accept(Channel* channel);
98 };
99
100 PEGASUS_NAMESPACE_END
101
102 #endif /* Pegasus_WindowsChannel_h */
|