17#ifndef _DECAF_INTERNAL_NET_TCP_TCPSOCKET_H_
18#define _DECAF_INTERNAL_NET_TCP_TCPSOCKET_H_
50 TcpSocket(
const TcpSocket&);
51 TcpSocket& operator=(
const TcpSocket&);
90 virtual void accept(SocketImpl* socket);
95 virtual void bind(
const std::string& ipaddress,
int port);
100 virtual void connect(
const std::string& hostname,
int port,
int timeout);
167 int read(
unsigned char* buffer,
int size,
int offset,
int length);
185 void write(
const unsigned char* buffer,
int size,
int offset,
int length);
int read(unsigned char *buffer, int size, int offset, int length)
Reads the requested data from the Socket and write it into the passed in buffer.
virtual void bind(const std::string &ipaddress, int port)
Binds this Socket instance to the local ip address and port number given.
virtual int available()
Gets the number of bytes that can be read from the Socket without blocking.the number of bytes that c...
virtual std::string getLocalAddress() const
Gets the value of the local Inet address the Socket is bound to if bound, otherwise return the InetAd...
virtual void shutdownOutput()
Disables the output stream for this socket.For a TCP socket, any previously written data will be sent...
virtual void shutdownInput()
Places the input stream for this socket at "end of stream".Any data sent to this socket is acknowledg...
TcpSocket()
Construct a non-connected socket.
virtual int getOption(int option) const
Gets the specified Socket option.the value of the given socket option.
virtual decaf::io::OutputStream * getOutputStream()
Gets the OutputStream linked to this Socket.an OutputStream pointer owned by the Socket object.
virtual decaf::io::InputStream * getInputStream()
Gets the InputStream linked to this Socket.an InputStream pointer owned by the Socket object.
virtual void accept(SocketImpl *socket)
virtual void setOption(int option, int value)
Sets the specified option on the Socket if supported.
virtual void listen(int backlog)
Sets the maximum queue length for incoming connection indications (a request to connect) to the count...
virtual void connect(const std::string &hostname, int port, int timeout)
Connects this socket to the given host and port.
void checkResult(apr_status_t value) const
void write(const unsigned char *buffer, int size, int offset, int length)
Writes the specified data in the passed in buffer to the Socket.
virtual void create()
Creates the underlying platform Socket data structures which allows for Socket options to be applied....
virtual ~TcpSocket()
Releases the socket handle but not gracefully shut down the connection.
virtual void close()
Closes the socket, terminating any blocked reads or writes.
Output stream for performing write operations on a socket.
Definition TcpSocketOutputStream.h:37
Base interface for any class that wants to represent an output stream of bytes.
Definition OutputStream.h:39
Acts as a base class for all physical Socket implementations.
Definition SocketImpl.h:42
int port
The remote port that this Socket is connected to.
Definition SocketImpl.h:48
#define DECAF_API
Definition Config.h:29
Definition TcpSocket.h:34
Definition DefaultServerSocketFactory.h:27
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25