#include <TCPSocket.h>
Inheritance diagram for acdk::net::TCPSocket:
Public Member Functions | |
TCPSocket () | |
virtual | ~TCPSocket () |
virtual bool | accept (IN(RSocketImpl) s, int timeOut=-1) |
Accepts a connection. | |
virtual int | available () |
Returns the number of bytes that can be read from this socket without blocking. | |
virtual void | bind (IN(RInetAddress) host, int port) |
Binds this socket to the specified port number on the specified host. | |
virtual void | close () |
Closes this socket. | |
virtual bool | connect (IN(RInetAddress) address, int port, int timeOut=-1) |
Connects this socket to the specified port number on the specified host. | |
virtual bool | connect (IN(RString) host, int port, int timeOut=-1) |
Connects this socket to the specified port on the named host. | |
virtual void | create (bool stream) |
Creates either a stream or a datagram socket. | |
RInetAddress | getInetAddress () |
Returns the value of this socket's address field. | |
int | getLocalPort () |
Returns the value of this socket's localport field. | |
virtual RReader | getInputStream () |
Returns an input stream for this socket. | |
virtual RWriter | getOutputStream () |
Returns an output stream for this socket. | |
virtual void | listen (int backlog) |
Sets the maximum queue length for incoming connection indications (a request to connect) to the count argument. | |
virtual jlong | seek (::acdk::io::SeekPos seekrel, jlong seekpos) |
virtual jlong | skip (jlong n) |
Move forwart into the stream. | |
virtual int | read () |
read a single byte from stream | |
virtual int | read (IN(RbyteArray) buffer, int offset=0, int len=-1) |
read the len bytes into buffer at offset of the buffer | |
virtual int | read (byte *buffer, int offset, int len) |
virtual void | mark (int readAheadLimit) |
virtual bool | markSupported () |
virtual void | reset () |
if mark is set, set stream to mark point otherwise to begin of this stream. | |
virtual bool | ready () |
virtual void | flush () |
virtual void | write (const byte *cstr, int offset, int len) |
virtual void | write (byte c) |
default implementation: byte cbuf[2]; cbuf[1] = 0; cbuf[0] = c; return write((const byte*)cbuf, 0, 1); | |
virtual void | write (IN(RbyteArray) ch, int offset=0, int len=-1) |
Uses write(byte c) to write bytes. | |
virtual RString | getDeviceName () |
virtual bool | isWriteable () |
virtual bool | isReadable () |
virtual bool | isConnected () |
void | send (IN(RDatagramPacket) packet) |
void | receive (IN(RDatagramPacket) packet) |
void | setSoTimeout (int timeOut) |
int | getSoTimeout () |
bool | isBound () |
int | getSetSocketErrno (int newErrno=0) |
return errno. | |
Static Public Member Functions | |
void | inetSocketAddress2native (IN(RInetSocketAddress) isa, sockaddr_in &_address) |
RInetSocketAddress | native2InetSocketAddress (const sockaddr_in &_address) |
Private Member Functions | |
void | _resolveLocalPortAddress () |
Private Attributes | |
bool | _connected |
bool | _eof |
bool | _eofReturned |
bool | _bound |
sockaddr_in | _address |
|
|
|
|
|
|
|
Accepts a connection.
Implements acdk::net::SocketImpl. |
|
Returns the number of bytes that can be read from this socket without blocking.
Reimplemented from acdk::io::Reader. |
|
Binds this socket to the specified port number on the specified host.
Implements acdk::net::SocketImpl. |
|
Closes this socket.
Reimplemented from acdk::io::Reader. |
|
Connects this socket to the specified port on the named host.
Implements acdk::net::SocketImpl. |
|
Connects this socket to the specified port number on the specified host.
Implements acdk::net::SocketImpl. |
|
Creates either a stream or a datagram socket.
Implements acdk::net::SocketImpl. |
|
Implements acdk::io::Writer. |
|
Implements acdk::io::Storage. |
|
Returns the value of this socket's address field.
Reimplemented from acdk::net::SocketImpl. |
|
Returns an input stream for this socket.
Implements acdk::net::SocketImpl. |
|
Returns the value of this socket's localport field.
Reimplemented from acdk::net::SocketImpl. |
|
Returns an output stream for this socket.
Implements acdk::net::SocketImpl. |
|
return errno. if newErrno == -1 the errno will not be set |
|
|
|
|
|
|
|
|
|
Implements acdk::io::Storage. |
|
Implements acdk::io::Storage. |
|
Sets the maximum queue length for incoming connection indications (a request to connect) to the count argument.
Implements acdk::net::SocketImpl. |
|
Reimplemented from acdk::io::Reader. |
|
Reimplemented from acdk::io::Reader. |
|
|
|
Reimplemented from acdk::io::Reader. |
|
read the len bytes into buffer at offset of the buffer
Reimplemented from acdk::io::Reader. |
|
read a single byte from stream
Reimplemented from acdk::io::Reader. |
|
Reimplemented from acdk::io::Reader. |
|
|
|
if mark is set, set stream to mark point otherwise to begin of this stream.
Implements acdk::io::Reader. |
|
|
|
|
|
|
|
Move forwart into the stream.
Implements acdk::io::Reader. |
|
Uses write(byte c) to write bytes. For performance reason this method should be implemented Reimplemented from acdk::io::Writer. |
|
default implementation: byte cbuf[2]; cbuf[1] = 0; cbuf[0] = c; return write((const byte*)cbuf, 0, 1);
Implements acdk::io::Writer. |
|
Reimplemented from acdk::io::Writer. |
|
|
|
|
|
|
|
|
|
|