sipXcallLib home page


TaoTransportAgent.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 #ifndef _TaoTransportAgent_h_
13 #define _TaoTransportAgent_h_
14 
15 // SYSTEM INCLUDES
16 //#include <...>
17 
18 // APPLICATION INCLUDES
19 #include <os/OsSocket.h>
20 #include <os/OsConnectionSocket.h>
21 #include <os/OsTask.h>
22 #include <os/OsServerTask.h>
23 #include <os/OsBSem.h>
24 #include "tao/TaoMessage.h"
25 
26 // DEFINES
27 // MACROS
28 // EXTERNAL FUNCTIONS
29 // EXTERNAL VARIABLES
30 // CONSTANTS
31 // STRUCTS
32 // TYPEDEFS
33 // FORWARD DECLARATIONS
34 
35 //:Class short description which may consist of multiple lines (note the ':')
36 // Class detailed description which may extend to multiple lines
37 class TaoTransportAgent : public OsTask
38 {
39 /* //////////////////////////// PUBLIC //////////////////////////////////// */
40 public:
41 
42 /* ============================ CREATORS ================================== */
43 
44  TaoTransportAgent(OsSocket* socket = NULL,
45  const char* remoteHostName = NULL,
46  const char* callId = NULL,
47  const char* toField = NULL, const char* fromField = NULL);
48  //:Default constructor
49 
50  TaoTransportAgent(OsSocket* pSocket, OsServerTask* pServer);
51  //:Constructor
52 
53  virtual
55  //:Destructor
56 
57 /* ============================ MANIPULATORS ============================== */
58  int send(TaoMessage& rMsg);
59 
60  virtual int run(void* pArg);
61 
62  virtual OsStatus setErrno(int errno);
63  //:Set the errno status for the task
64  // This call has no effect under Windows NT and, if the task has been
65  // started, will always returns OS_SUCCESS
66 
67  /* ============================ ACCESSORS ================================= */
68 
69  void getHostIp(UtlString* hostAddress) const;
70  void getAgentName(UtlString* pAgentName) const;
71  void getCallId(UtlString* callId) const;
72  void getToField(UtlString* toField) const;
73  void getFromField(UtlString* fromField) const;
74  long getLastTouchedTime() const;
75  int getHostPort() const;
76 /* ============================ INQUIRY =================================== */
77 
78  UtlBoolean isOk();
79 
80 /* //////////////////////////// PROTECTED ///////////////////////////////// */
81 protected:
82 
83 /* //////////////////////////// PRIVATE /////////////////////////////////// */
84 private:
85 
86  OsSocket* mpSocket;
87  OsServerTask* mpServer;
88  UtlString viaName;
89  UtlString callIdLabel;
90  UtlString toFieldLabel;
91  UtlString fromFieldLabel;
93  OsBSem mWriteSem ;
94 
95  int readUntilDone(OsSocket* pSocket, char *pBuf, int iLength) ;
96  //: read iLength bytes from passed socket (waiting until completion)
97 
98 
99  TaoTransportAgent(const TaoTransportAgent& rTaoTransportAgent);
100  //:disable Copy constructor
101 
103  //:disable Assignment operator
104 
105 };
106 
107 #endif // _TaoTransportAgent_h_
virtual ~TaoTransportAgent()
Definition: TaoTransportAgent.cpp:81
int send(TaoMessage &rMsg)
Definition: TaoTransportAgent.cpp:156
OsServerTask * mpServer
Definition: TaoTransportAgent.h:87
UtlString fromFieldLabel
Definition: TaoTransportAgent.h:91
UtlString toFieldLabel
Definition: TaoTransportAgent.h:90
Definition: TaoMessage.h:51
UtlString callIdLabel
Definition: TaoTransportAgent.h:89
UtlString viaName
Definition: TaoTransportAgent.h:88
void getAgentName(UtlString *pAgentName) const
Definition: TaoTransportAgent.cpp:213
OsSocket * mpSocket
Definition: TaoTransportAgent.h:86
void getFromField(UtlString *fromField) const
Definition: TaoTransportAgent.cpp:225
void getToField(UtlString *toField) const
Definition: TaoTransportAgent.cpp:231
void getCallId(UtlString *callId) const
Definition: TaoTransportAgent.cpp:219
long touchedTime
Definition: TaoTransportAgent.h:92
int readUntilDone(OsSocket *pSocket, char *pBuf, int iLength)
Definition: TaoTransportAgent.cpp:276
long getLastTouchedTime() const
Definition: TaoTransportAgent.cpp:237
OsBSem mWriteSem
Definition: TaoTransportAgent.h:93
TaoTransportAgent(OsSocket *socket=NULL, const char *remoteHostName=NULL, const char *callId=NULL, const char *toField=NULL, const char *fromField=NULL)
Definition: TaoTransportAgent.cpp:39
TaoTransportAgent & operator=(const TaoTransportAgent &rhs)
Definition: TaoTransportAgent.cpp:198
Definition: TaoTransportAgent.h:37
int getHostPort() const
Definition: TaoTransportAgent.cpp:242
UtlBoolean isOk()
Definition: TaoTransportAgent.cpp:265
virtual OsStatus setErrno(int errno)
Definition: TaoTransportAgent.cpp:255
virtual int run(void *pArg)
Definition: TaoTransportAgent.cpp:97
void getHostIp(UtlString *hostAddress) const
Definition: TaoTransportAgent.cpp:208