sipxmedialib  Version 3.3
INetworkChannel.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 
12 // Border Guard
13 #ifndef _INetworkChannel_h
14 #define _INetworkChannel_h
15 
16 #include "rtcp/RtcpConfig.h"
17 
18 // Include
19 #include "IBaseClass.h"
20 
21 
36 interface INetworkChannel : public IBaseClass
37  {
38 
39 // Public Methods
40 
41 public:
42 
43 /*|><|************************************************************************
44  Name: CNetworkChannel::Initialize
45 
46  Description: A polymorphic method of INetworkChannel that handles the
47  creation and initialization of an inbound or outbound
48  connectionless datagram channels. The method shall create
49  and open the datagram channel in addition to binding it to
50  establish a local port ID.
51 
52  Returns: bool.
53  ***********************************************************************|><|*/
54  virtual bool Initialize(void)=0;
55 
56 
57 /*|><|************************************************************************
58  Name: Connect
59 
60  Description: A polymorphic method that manages the connection of an inbound
61  or outbound connectionless datagram channels over TCP/IP.
62  This is a non-blocking call.
63 
64  Returns: bool.
65  ***********************************************************************|><|*/
66  virtual bool Connect(unsigned char *puchIPAddress,
67  unsigned short usPortID)=0;
68 
69 
70 
71 /*|><|************************************************************************
72  Name: Close
73 
74  Description: A method that closes a connectionless datagram channel.
75 
76  Returns: bool.
77  ***********************************************************************|><|*/
78  virtual bool Close(void)=0;
79 
80 
81 
82 /*|><|************************************************************************
83  Name: GetSocket
84 
85  Description: An IChannel interface method that retrieves the socket handle
86  associated with a given channel.
87 
88  Returns: unsigned int.
89  ***********************************************************************|><|*/
90  virtual unsigned int GetSocket(void)=0;
91 
92 /*|><|************************************************************************
93  Name: GetPort
94 
95  Description: An IChannel interface method that retrieves the port ID
96  associated with a given channel.
97 
98  Returns: unsigned short.
99  ***********************************************************************|><|*/
100  virtual unsigned short GetPort(void)=0;
101 
102 
103 /*|><|************************************************************************
104  Name: IsOpened
105 
106  Description: An IChannel interface method that returns a flag identifying
107  whether a channel has been opened.
108 
109  Returns: None.
110  ***********************************************************************|><|*/
111  virtual bool IsOpened(void)=0;
112 
113 /*|><|************************************************************************
114  Name: IsConnected
115 
116  Description: An IChannel interface method that returns a flag identifying
117  whether a channel has been connected.
118 
119  Returns: None.
120  ***********************************************************************|><|*/
121  virtual bool IsConnected(void)=0;
122 
123 
124 };
125 
126 
127 #endif
virtual unsigned short GetPort(void)=0
virtual bool IsConnected(void)=0
virtual bool IsOpened(void)=0
virtual unsigned int GetSocket(void)=0
virtual bool Connect(unsigned char *puchIPAddress, unsigned short usPortID)=0
virtual bool Close(void)=0