Inheritance diagram for SocketConduit:
Public Member Functions | |
this () | |
IBuffer | createBuffer () |
void | setTimeout (uint us) |
bool | hadTimeout () |
void | attach (IConduitSource input) |
void | attach (IConduitSink output) |
int | read (IBuffer target) |
int | write (IBuffer source) |
bool | isSeekable () |
bool | isReadable () |
bool | isWritable () |
IConduit | copy (IConduit source) |
IConduit | flush (IBuffer source) |
ConduitStyle | getStyle () |
Static Public Member Functions | |
SocketConduit | create (socket_t handle) |
Protected Member Functions | |
void | bind (IConduitSink sink) |
void | bind (IConduitSource source) |
void | unbind () |
int | reader (void[] src) |
int | writer (void[] src) |
Private Types | |
enum | { Eof = -1 } |
Private Member Functions | |
void | fixup () |
this (socket_t handle) | |
this (Socket.AddressFamily af, Socket.Type type, Socket.Protocol protocol) | |
void | set (socket_t sock) |
void | reset () |
void | create (Socket.AddressFamily af, Socket.Type type, Socket.Protocol protocol) |
socket_t | handle () |
char[] | toString () |
bit | blocking () |
void | blocking (bit byes) |
AddressFamily | addressFamily () |
bit | isAlive () |
void | bind (Address addr) |
void | connect (Address to) |
void | listen (int backlog) |
Socket | createSocket (socket_t handle) |
Socket | accept () |
void | shutdown () |
void | shutdown (Socket.Shutdown how) |
void | setLingerPeriod (int period) |
void | setAddressReuse (bool enabled) |
bool | setGroup (InternetAddress address, Socket.Option option) |
void | closure () |
bit | poll (events) |
Object | getLock () |
void | setLock (Object lock) |
void | acquire () |
bool | acquireIfOpen () |
void | close () |
Static Private Member Functions | |
bool | isCancelled () |
void | cancelAll (bool cancel) |
int | select (SocketSet checkRead, SocketSet checkWrite, SocketSet checkError, timeval *tv) |
int | select (SocketSet checkRead, SocketSet checkWrite, SocketSet checkError, int microseconds) |
int | select (SocketSet checkRead, SocketSet checkWrite, SocketSet checkError) |
Private Attributes | |
timeval | tv |
SocketSet | ss |
IConduitSource | input |
IConduitSink | output |
bool | timeout |
Definition at line 59 of file SocketConduit.d.
|
Declare the End Of File identifer Definition at line 67 of file IConduit.d. |
|
Definition at line 167 of file SocketConduit.d. Referenced by SocketConduit::VersionUseFreeList::closure(), and this(). |
|
Construct this SocketConduit with the given socket handle; this is for FreeList and ServerSocket support. Definition at line 180 of file SocketConduit.d. References SocketConduit, and version. |
|
Create a streaming Internet Socket Reimplemented from Resource. Definition at line 200 of file SocketConduit.d. References fixup(). |
|
Construct this SocketConduit with the given socket handle; this is for FreeList and ServerSocket support. Reimplemented from Socket. Definition at line 213 of file SocketConduit.d. References fixup(). |
|
Create a Buffer of a conduit-specific size. I think 8K bytes is the common standard for socket buffering? Reimplemented from IConduit. Definition at line 226 of file SocketConduit.d. References Buffer, and Buffer::setConduit(). Referenced by HttpClient::open(), SocketAppender::setAddress(), testHttpClient2(), and testSocketRegex(). |
|
Set the read timeout to the specified microseconds. Set a value of zero to disable timeout support. Definition at line 240 of file SocketConduit.d. References tv. Referenced by HttpClient::open(), ConnectionPool::PoolConnection::reset(), testHttpClient(), testHttpClient2(), testSocket(), and testSocketRegex(). |
|
Did the last operation result in a timeout? Note that this assumes there is no thread contention on this object. Definition at line 253 of file SocketConduit.d. |
|
Please refer to IConduit.attach for details Reimplemented from IConduit. Definition at line 264 of file SocketConduit.d. References IConduitSource::bind(). |
|
Please refer to IConduit.attach for details Reimplemented from IConduit. Definition at line 276 of file SocketConduit.d. References IConduitSink::bind(). |
|
Reimplemented from IConduitSink. Definition at line 286 of file SocketConduit.d. |
|
Reimplemented from IConduitSource. Definition at line 294 of file SocketConduit.d. |
|
Reimplemented from IConduitSource. Definition at line 302 of file SocketConduit.d. |
|
Callback routine to read content from the socket. Note that the operation may timeout if method setTimeout() has been invoked with a non-zero value. Returns the number of bytes read from the socket, or IConduit.Eof where there's no more content available Note that a timeout is equivalent to Eof. Isolating a timeout condition can be achieved via hadTimeout() Note also that a zero return value is not legitimate; such a value indicates Eof Reimplemented from IConduitSource. Definition at line 323 of file SocketConduit.d. References SocketSet::add(), Socket::receive(), SocketSet::reset(), Socket::select(), ss, and tv. |
|
Callback routine to write the provided content to the socket. This will stall until the socket responds in some manner. Returns the number of bytes sent to the output, or IConduit.Eof if the socket cannot write. Reimplemented from IConduitSink. Definition at line 367 of file SocketConduit.d. References Socket::send(). |
|
Read from conduit into a target buffer. Note that this uses SocketSet to handle timeouts, such that the socket does not stall forever. Reimplemented from IConduit. Definition at line 383 of file SocketConduit.d. Referenced by HttpClient::read(), testClient(), and testHttpClient2(). |
|
Write to conduit from a source buffer. Reimplemented from IConduit. Definition at line 396 of file SocketConduit.d. Referenced by flush(), and testClient(). |
|
This conduit is not seekable Reimplemented from IConduit. Definition at line 414 of file SocketConduit.d. |
|
This conduit is readable Reimplemented from IConduit. Definition at line 425 of file SocketConduit.d. |
|
This conduit is writable Reimplemented from IConduit. Definition at line 436 of file SocketConduit.d. |
|
Transfer the content of this conduit to another one. Returns true if all content was successfully copied. Reimplemented from IConduit. Definition at line 448 of file SocketConduit.d. |
|
Flush buffer content out to this conduit. Returns true if all content is flushed; false if writing results in an Eof condition. Reimplemented from IConduit. Definition at line 471 of file SocketConduit.d. References IBuffer::readable(), and write(). |
|
Return the style used to open the conduit Definition at line 485 of file SocketConduit.d. References ConduitStyle::ReadWrite. |
|
Definition at line 773 of file Socket.d. References Resource::acquire(), and Socket::create(). |
|
MANGO: moved this out from the above constructor so that it can be called from the FreeList version of SocketConduit Definition at line 492 of file Socket.d. References Resource::acquire(). Referenced by SocketConduit::VersionUseFreeList::allocate(), and Socket::this(). |
|
MANGO: added to reset socket Definition at line 506 of file Socket.d. References INVALID_SOCKET. Referenced by SocketConduit::VersionUseFreeList::deallocate(). |
|
MANGO: added for subscriber control Definition at line 520 of file Socket.d. References Socket::cancelled. |
|
MANGO: added for subscriber control Definition at line 531 of file Socket.d. References Socket::cancelled, and version. |
|
MANGO: added for multicast support Definition at line 788 of file Socket.d. References Socket::_family, and Socket::sock. Referenced by ServerSocket::createSocket(), MulticastSocket::leave(), and Socket::this(). |
|
get underlying socket handle Definition at line 803 of file Socket.d. References Socket::sock. Referenced by Socket::setGroup(). |
|
|
|
getter Definition at line 826 of file Socket.d. References Socket::_blocking, and version. |
|
setter Definition at line 845 of file Socket.d. References Socket::_blocking, Socket::sock, SOCKET_ERROR, and version. |
|
Definition at line 876 of file Socket.d. References Socket::_family. |
|
Definition at line 887 of file Socket.d. References Socket::sock, and SOCKET_ERROR. |
|
Definition at line 899 of file Socket.d. References Address::name(), Address::nameLen(), Socket::sock, and SOCKET_ERROR. Referenced by MulticastSocket::join(), and ServerSocket::this(). |
|
Definition at line 911 of file Socket.d. References Address::name(), Address::nameLen(), Socket::sock, SOCKET_ERROR, and version. Referenced by HttpClient::open(), ConnectionPool::PoolConnection::reset(), SocketAppender::setAddress(), testClient(), testClusterServer(), testHttpClient(), testHttpClient2(), testSocket(), and testSocketRegex(). |
|
need to bind() first Definition at line 943 of file Socket.d. References Socket::sock, and SOCKET_ERROR. Referenced by ServerSocket::this(). |
|
MANGO: added Reimplemented in ServerSocket. Definition at line 955 of file Socket.d. References Socket. Referenced by Socket::accept(). |
|
Reimplemented in ServerSocket. Definition at line 965 of file Socket.d. References Socket::_blocking, Socket::_family, Socket::createSocket(), INVALID_SOCKET, Socket::sock, and version. Referenced by ServerSocket::accept(). |
|
Definition at line 991 of file Socket.d. References Socket::sock. Referenced by HttpClient::close(), and testClient(). |
|
Definition at line 1001 of file Socket.d. References Socket::sock. |
|
MANGO: added Reimplemented in ServerSocket. Definition at line 1013 of file Socket.d. References Socket::setOption(). Referenced by ServerSocket::createSocket(), and testClient(). |
|
MANGO: added Definition at line 1031 of file Socket.d. References Socket::setOption(). Referenced by MulticastSocket::join(), and ServerSocket::this(). |
|
Helper function to handle the adding and dropping of group membership. MANGO: Added Definition at line 1047 of file Socket.d. References Socket::handle(), InternetAddress::sin, and SOCKET_ERROR. Referenced by MulticastSocket::pauseGroup(), and MulticastSocket::resumeGroup(). |
|
calling shutdown() before this is recommended for connection- oriented sockets MANGO: changed from close() to IResource.closure() Reimplemented from Resource. Definition at line 1072 of file Socket.d. References Socket::sock, and version. Referenced by MulticastSocket::leave(). |
|
SocketSet's are updated to include only those sockets which an event occured. Returns the number of events, 0 on timeout, or -1 on interruption for a connect()ing socket, writeability means connected for a listen()ing socket, readability means listening Winsock: possibly internally limited to 64 sockets per set Definition at line 1377 of file Socket.d. Referenced by Socket::poll(), and reader(). |
|
|
|
maximum timeout |
|
Definition at line 1457 of file Socket.d. References Socket::select(). |
|
Return the lock used by this resource Reimplemented in Resource. |
|
Set an alternate lock. Typically one would use this to synchronize multiple different Resources via a common object. Reimplemented in Resource. |
|
hold a reference to this resource. The caller is now responsible for invoking close() upon this resource; Reimplemented in Resource. |
|
If this resource is still open, acquire it and return true. This is a threadsafe test-and-set mechanism that fails only if the resource is already closed, or was never opened. Note that you are responsible for invoking close() whenever this method returns true. Reimplemented in Resource. |
|
release a reference to this resource Reimplemented in Resource. Referenced by HttpClient::close(), ConnectionPool::PoolConnection::close(), HttpBridge::cross(), ClusterThread::run(), and testClient(). |
|
Definition at line 61 of file SocketConduit.d. Referenced by reader(), and setTimeout(). |
|
Definition at line 62 of file SocketConduit.d. Referenced by reader(). |
|
Definition at line 63 of file SocketConduit.d. |
|
Definition at line 64 of file SocketConduit.d. |
|
Definition at line 65 of file SocketConduit.d. |