activemq-cpp-3.6.0
Main Page
Namespaces
Data Structures
Files
File List
Globals
TcpSocket.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
#ifndef _DECAF_INTERNAL_NET_TCP_TCPSOCKET_H_
18
#define _DECAF_INTERNAL_NET_TCP_TCPSOCKET_H_
19
20
#include <
decaf/net/SocketException.h
>
21
#include <
decaf/net/SocketImpl.h
>
22
#include <
decaf/io/InputStream.h
>
23
#include <
decaf/io/OutputStream.h
>
24
#include <
decaf/util/Config.h
>
25
#include <
decaf/internal/AprPool.h
>
26
#include <
decaf/io/IOException.h
>
27
#include <
decaf/net/SocketTimeoutException.h
>
28
#include <
decaf/lang/exceptions/NullPointerException.h
>
29
#include <
decaf/lang/exceptions/IndexOutOfBoundsException.h
>
30
31
namespace
decaf {
32
namespace
internal {
33
namespace
net {
34
namespace
tcp {
35
36
class
TcpSocketInputStream
;
37
class
TcpSocketOutputStream
;
38
class
TcpSocketImpl;
39
43
class
DECAF_API
TcpSocket
:
public
decaf::net::SocketImpl
{
44
private
:
45
46
TcpSocketImpl* impl;
47
48
private
:
49
50
TcpSocket
(
const
TcpSocket
&);
51
TcpSocket
& operator=(
const
TcpSocket
&);
52
53
public
:
54
60
TcpSocket
();
61
65
virtual
~
TcpSocket
();
66
70
bool
isConnected()
const
;
71
75
bool
isClosed()
const
;
76
80
virtual
std::string getLocalAddress()
const
;
81
85
virtual
void
create();
86
90
virtual
void
accept(SocketImpl* socket);
91
95
virtual
void
bind(
const
std::string& ipaddress,
int
port);
96
100
virtual
void
connect(
const
std::string& hostname,
int
port,
int
timeout);
101
105
virtual
void
listen(
int
backlog);
106
110
virtual
decaf::io::InputStream
* getInputStream();
111
115
virtual
decaf::io::OutputStream
* getOutputStream();
116
120
virtual
int
available();
121
125
virtual
void
close();
126
130
virtual
void
shutdownInput();
131
135
virtual
void
shutdownOutput();
136
140
virtual
int
getOption(
int
option)
const
;
141
145
virtual
void
setOption(
int
option,
int
value);
146
147
public
:
148
167
int
read(
unsigned
char
* buffer,
int
size,
int
offset,
int
length);
168
185
void
write(
const
unsigned
char
* buffer,
int
size,
int
offset,
int
length);
186
187
protected
:
188
189
void
checkResult(apr_status_t value)
const
;
190
191
};
192
193
}}}}
194
195
#endif
/*_DECAF_INTERNAL_NET_TCP_TCPSOCKET_H_*/
src
main
decaf
internal
net
tcp
TcpSocket.h
Generated on Mon Mar 4 2013 10:25:45 for activemq-cpp-3.6.0 by
1.8.1.2