activemq-cpp-3.8.2
TcpTransport.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _ACTIVEMQ_TRANSPORT_TCP_TCPTRANSPORT_H_
19 #define _ACTIVEMQ_TRANSPORT_TCP_TCPTRANSPORT_H_
20 
23 #include <activemq/util/Config.h>
25 #include <decaf/net/Socket.h>
26 #include <decaf/net/URI.h>
27 #include <decaf/util/Properties.h>
28 #include <decaf/lang/Pointer.h>
33 #include <memory>
34 
35 namespace activemq {
36 namespace transport {
37 namespace tcp {
38 
40 
41  class TcpTransportImpl;
42 
49  private:
50 
51  TcpTransportImpl* impl;
52 
53  private:
54 
55  TcpTransport(const TcpTransport&);
56  TcpTransport& operator=(const TcpTransport&);
57 
58  public:
59 
69  TcpTransport(const Pointer<Transport> next, const decaf::net::URI& location);
70 
71  virtual ~TcpTransport();
72 
73  void setConnectTimeout(int soConnectTimeout);
74  int getConnectTimeout() const;
75 
76  void setOutputBufferSize(int outputBufferSize);
77  int getOutputBufferSize() const;
78 
79  void setInputBufferSize(int inputBufferSize);
80  int getInputBufferSize() const;
81 
82  void setTrace(bool trace);
83  bool isTrace() const;
84 
85  void setLinger(int soLinger);
86  int getLinger() const;
87 
88  void setKeepAlive(bool soKeepAlive);
89  bool isKeepAlive() const;
90 
91  void setReceiveBufferSize(int soReceiveBufferSize);
92  int getReceiveBufferSize() const;
93 
94  void setSendBufferSize(int soSendBufferSize);
95  int getSendBufferSize() const;
96 
97  void setTcpNoDelay(bool tcpNoDelay);
98  bool isTcpNoDelay() const;
99 
100  public: // Transport Methods
101 
102  virtual bool isFaultTolerant() const {
103  return false;
104  }
105 
106  virtual bool isConnected() const;
107 
108  protected:
109 
110  decaf::net::URI getLocation() const;
111 
112  virtual void beforeNextIsStarted();
113 
114  virtual void afterNextIsStopped();
115 
116  virtual void doClose();
117 
122  void connect();
123 
132  virtual decaf::net::Socket* createSocket();
133 
147  virtual void configureSocket(decaf::net::Socket* socket);
148 
149  };
150 
151 }}}
152 
153 #endif /*_ACTIVEMQ_TRANSPORT_TCP_TCPTRANSPORT_H_*/
#define AMQCPP_API
Definition: Config.h:30
Implements a TCP/IP based transport filter, this transport is meant to wrap an instance of an IOTrans...
Definition: TcpTransport.h:48
Definition: Socket.h:44
A filter on the transport layer.
Definition: TransportFilter.h:44
This class represents an instance of a URI as defined by RFC 2396.
Definition: URI.h:36
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: CachedConsumer.h:24
Decaf&#39;s implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition: Pointer.h:53
virtual bool isFaultTolerant() const
Is this Transport fault tolerant, meaning that it will reconnect to a broker on disconnect.
Definition: TcpTransport.h:102