18#ifndef _DECAF_NET_SOCKETIMPL_H_
19#define _DECAF_NET_SOCKETIMPL_H_
67 SocketImpl(
const SocketImpl& );
68 SocketImpl& operator= (
const SocketImpl& );
96 virtual void accept( SocketImpl* socket ) = 0;
112 virtual void connect(
const std::string& hostname,
int port,
int timeout ) = 0;
124 virtual void bind(
const std::string& ipaddress,
int port ) = 0;
230 return this->localPort;
239 return this->address;
This class servers as an opaque wrapper around an underlying OS level resource that can be used as a ...
Definition FileDescriptor.h:32
Base interface for any class that wants to represent an output stream of bytes.
Definition OutputStream.h:39
virtual int getOption(int option) const =0
Gets the specified Socket option.
io::FileDescriptor * fd
The File Descriptor for this Socket.
Definition SocketImpl.h:63
virtual void connect(const std::string &hostname, int port, int timeout)=0
Connects this socket to the given host and port.
std::string toString() const
Returns a string containing the address and port of this Socket instance.
std::string address
The Remote Address that the Socket is connected to.
Definition SocketImpl.h:58
int port
The remote port that this Socket is connected to.
Definition SocketImpl.h:48
virtual void bind(const std::string &ipaddress, int port)=0
Binds this Socket instance to the local ip address and port number given.
virtual int available()=0
Gets the number of bytes that can be read from the Socket without blocking.
virtual decaf::io::OutputStream * getOutputStream()=0
Gets the OutputStream linked to this Socket.
int getPort() const
Gets the port that this socket has been assigned.
Definition SocketImpl.h:220
virtual void close()=0
Closes the socket, terminating any blocked reads or writes.
virtual void shutdownOutput()=0
Disables the output stream for this socket.
virtual void create()=0
Creates the underlying platform Socket data structures which allows for Socket options to be applied.
virtual void shutdownInput()=0
Places the input stream for this socket at "end of stream".
std::string getInetAddress() const
Gets the value of this SocketImpl's address field.
Definition SocketImpl.h:238
virtual decaf::io::InputStream * getInputStream()=0
Gets the InputStream linked to this Socket.
virtual void listen(int backlog)=0
Sets the maximum queue length for incoming connection indications (a request to connect) to the count...
int localPort
The port on the Local Machine that this Socket is Bound to.
Definition SocketImpl.h:53
virtual void setOption(int option, int value)=0
Sets the specified option on the Socket if supported.
virtual void accept(SocketImpl *socket)=0
Accepts a new connection on the given Socket.
const decaf::io::FileDescriptor * getFileDescriptor() const
Gets the FileDescriptor for this Socket, the Object is owned by this Socket and should not be deleted...
Definition SocketImpl.h:248
virtual bool supportsUrgentData() const
Definition SocketImpl.h:271
virtual std::string getLocalAddress() const =0
Gets the value of the local Inet address the Socket is bound to if bound, otherwise return the InetAd...
int getLocalPort() const
Gets the value of this SocketImpl's local port field.
Definition SocketImpl.h:229
virtual void sendUrgentData(int data)
Sends on byte of urgent data to the Socket.
Definition SocketOptions.h:30
#define DECAF_API
Definition Config.h:29
Definition URLStreamHandlerManager.h:26
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25