Inheritance diagram for SocketConduit:
Public Member Functions | |
this () | |
IBuffer | createBuffer () |
void | setTimeout (uint us) |
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 |
Definition at line 55 of file SocketConduit.d.
|
Declare the End Of File identifer Definition at line 64 of file IConduit.d. |
|
Definition at line 162 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 175 of file SocketConduit.d. References SocketConduit, and version. |
|
Create a streaming Internet Socket Reimplemented from Resource. Definition at line 195 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 208 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 221 of file SocketConduit.d. References Buffer, and Buffer::setConduit(). Referenced by HttpClient::open(), VersionMango::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 235 of file SocketConduit.d. References tv. Referenced by HttpClient::open(), ConnectionPool::PoolConnection::reset(), testHttpClient(), testHttpClient2(), testSocket(), and testSocketRegex(). |
|
Please refer to IConduit.attach for details Reimplemented from IConduit. Definition at line 247 of file SocketConduit.d. References IConduitSource::bind(). |
|
Please refer to IConduit.attach for details Reimplemented from IConduit. Definition at line 259 of file SocketConduit.d. References IConduitSink::bind(). |
|
Reimplemented from IConduitSink. Definition at line 269 of file SocketConduit.d. |
|
Reimplemented from IConduitSource. Definition at line 277 of file SocketConduit.d. |
|
Reimplemented from IConduitSource. Definition at line 285 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 Reimplemented from IConduitSource. Definition at line 300 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 336 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 352 of file SocketConduit.d. Referenced by HttpClient::read(), testClient(), and testHttpClient2(). |
|
Write to conduit from a source buffer. Reimplemented from IConduit. Definition at line 365 of file SocketConduit.d. Referenced by flush(), and testClient(). |
|
This conduit is not seekable Reimplemented from IConduit. Definition at line 383 of file SocketConduit.d. |
|
This conduit is readable Reimplemented from IConduit. Definition at line 394 of file SocketConduit.d. |
|
This conduit is writable Reimplemented from IConduit. Definition at line 405 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 417 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 440 of file SocketConduit.d. References IBuffer::readable(), and write(). |
|
Return the style used to open the conduit Definition at line 454 of file SocketConduit.d. References ConduitStyle::ReadWrite. |
|
Definition at line 774 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 493 of file Socket.d. References Resource::acquire(). Referenced by SocketConduit::VersionUseFreeList::allocate(), and Socket::this(). |
|
MANGO: added to reset socket Definition at line 507 of file Socket.d. References INVALID_SOCKET. Referenced by SocketConduit::VersionUseFreeList::deallocate(). |
|
MANGO: added for subscriber control Definition at line 521 of file Socket.d. References Socket::cancelled. |
|
MANGO: added for subscriber control Definition at line 532 of file Socket.d. References Socket::cancelled, and version. |
|
MANGO: added for multicast support Definition at line 789 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 804 of file Socket.d. References Socket::sock. Referenced by Socket::setGroup(). |
|
|
|
getter Definition at line 827 of file Socket.d. References Socket::_blocking, and version. |
|
setter Definition at line 846 of file Socket.d. References Socket::_blocking, Socket::sock, SOCKET_ERROR, and version. |
|
Definition at line 877 of file Socket.d. References Socket::_family. |
|
Definition at line 888 of file Socket.d. References Socket::sock, and SOCKET_ERROR. |
|
Definition at line 900 of file Socket.d. References Address::name(), Address::nameLen(), Socket::sock, and SOCKET_ERROR. Referenced by MulticastSocket::join(), and ServerSocket::this(). |
|
Definition at line 912 of file Socket.d. References Address::name(), Address::nameLen(), Socket::sock, SOCKET_ERROR, and version. Referenced by HttpClient::open(), ConnectionPool::PoolConnection::reset(), VersionMango::SocketAppender::setAddress(), testClient(), testClusterServer(), testHttpClient(), testHttpClient2(), testSocket(), and testSocketRegex(). |
|
need to bind() first Definition at line 944 of file Socket.d. References Socket::sock, and SOCKET_ERROR. Referenced by ServerSocket::this(). |
|
MANGO: added Reimplemented in ServerSocket. Definition at line 956 of file Socket.d. References Socket. Referenced by Socket::accept(). |
|
Reimplemented in ServerSocket. Definition at line 966 of file Socket.d. References Socket::_blocking, Socket::_family, Socket::createSocket(), INVALID_SOCKET, Socket::sock, and version. Referenced by ServerSocket::accept(). |
|
Definition at line 992 of file Socket.d. References Socket::sock. Referenced by HttpClient::close(), and testClient(). |
|
Definition at line 1002 of file Socket.d. References Socket::sock. |
|
MANGO: added Reimplemented in ServerSocket. Definition at line 1014 of file Socket.d. References Socket::setOption(). Referenced by ServerSocket::createSocket(), and testClient(). |
|
MANGO: added Definition at line 1032 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 1048 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 1073 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 1378 of file Socket.d. Referenced by Socket::poll(), and reader(). |
|
|
|
maximum timeout |
|
Definition at line 1458 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 57 of file SocketConduit.d. Referenced by reader(), and setTimeout(). |
|
Definition at line 58 of file SocketConduit.d. Referenced by reader(). |
|
Definition at line 59 of file SocketConduit.d. |
|
Definition at line 60 of file SocketConduit.d. |