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 (void[] src) |
int | write (void[] src) |
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 | |
static SocketConduit | create (socket_t handle) |
Protected Member Functions | |
void | bind (IConduitSink sink) |
void | bind (IConduitSource source) |
void | unbind () |
Private Types | |
enum | { Eof = -1 } |
Private Member Functions | |
void | fixup () |
this (socket_t handle) | |
this (AddressFamily af, Type type, Protocol protocol) | |
void | set (socket_t sock) |
void | reset () |
void | create (AddressFamily af, Type type, 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 (Shutdown how) |
void | setLingerPeriod (int period) |
void | setAddressReuse (bool enabled) |
bool | setGroup (InternetAddress address, Option option) |
void | closure () |
bit | poll (events) |
Object | getLock () |
void | setLock (Object lock) |
void | acquire () |
bool | acquireIfOpen () |
void | close () |
Static Private Member Functions | |
static bool | isCancelled () |
static void | cancelAll (bool cancel) |
static int | select (SocketSet checkRead, SocketSet checkWrite, SocketSet checkError, timeval *tv) |
static int | select (SocketSet checkRead, SocketSet checkWrite, SocketSet checkError, int microseconds) |
static int | select (SocketSet checkRead, SocketSet checkWrite, SocketSet checkError) |
Private Attributes | |
timeval | tv |
SocketSet | ss |
IConduitSource | input |
IConduitSink | output |
bool | timeout |
Classes | |
class | VersionUseFreeList |
Definition at line 62 of file SocketConduit.d.
|
Declare the End Of File identifer Definition at line 68 of file IConduit.d. |
|
Definition at line 170 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 183 of file SocketConduit.d. References SocketConduit, and version. |
|
Create a streaming Internet Socket Reimplemented from Resource. Definition at line 203 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 216 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 229 of file SocketConduit.d. References Buffer, and Buffer::setConduit(). Referenced by HttpClient::open(), SocketAppender::setAddress(), and testHttpClient2(). |
|
Set the read timeout to the specified microseconds. Set a value of zero to disable timeout support. Definition at line 243 of file SocketConduit.d. References tv. Referenced by HttpClient::open(), testHttpClient(), testHttpClient2(), and testSocket(). |
|
Did the last operation result in a timeout? Note that this assumes there is no thread contention on this object. Definition at line 256 of file SocketConduit.d. References timeout. |
|
Please refer to IConduit.attach for details Reimplemented from IConduit. Definition at line 267 of file SocketConduit.d. References IConduitSource::bind(). |
|
Please refer to IConduit.attach for details Reimplemented from IConduit. Definition at line 279 of file SocketConduit.d. References IConduitSink::bind(). |
|
Reimplemented from IConduitSink. Definition at line 289 of file SocketConduit.d. |
|
Reimplemented from IConduitSource. Definition at line 297 of file SocketConduit.d. |
|
Reimplemented from IConduitSource. Definition at line 305 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 IConduit. Definition at line 326 of file SocketConduit.d. References SocketSet::add(), Socket::receive(), SocketSet::reset(), Socket::select(), ss, timeout, and tv. Referenced by HttpClient::read(), testClient(), and testHttpClient2(). |
|
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 IConduit. Definition at line 370 of file SocketConduit.d. References Socket::send(). Referenced by flush(), and testClient(). |
|
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 386 of file SocketConduit.d. References assert(). |
|
Write to conduit from a source buffer. Reimplemented from IConduit. Definition at line 399 of file SocketConduit.d. References assert(). |
|
This conduit is not seekable Reimplemented from IConduit. Definition at line 417 of file SocketConduit.d. |
|
This conduit is readable Reimplemented from IConduit. Definition at line 428 of file SocketConduit.d. |
|
This conduit is writable Reimplemented from IConduit. Definition at line 439 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 451 of file SocketConduit.d. References assert(). Referenced by testSocket(). |
|
Flush buffer content out to this conduit. Returns true if all content is flushed; false if writing results in an Eof condition. Definition at line 474 of file SocketConduit.d. References write(). |
|
Return the style used to open the conduit Definition at line 488 of file SocketConduit.d. References ConduitStyle::ReadWrite. |
|
Definition at line 869 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 518 of file Socket.d. References Resource::acquire(). Referenced by SocketConduit::VersionUseFreeList::allocate(), and Socket::this(). |
|
MANGO: added to reset socket Definition at line 532 of file Socket.d. References INVALID_SOCKET. Referenced by SocketConduit::VersionUseFreeList::deallocate(). |
|
MANGO: added for subscriber control Definition at line 546 of file Socket.d. References Socket::cancelled. |
|
MANGO: added for subscriber control Definition at line 557 of file Socket.d. References Socket::cancelled, printf(), and version. |
|
MANGO: added for multicast support Definition at line 884 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 899 of file Socket.d. References Socket::sock. Referenced by Socket::blocking(), and Socket::setGroup(). |
|
|
|
getter Definition at line 922 of file Socket.d. References Socket::_blocking, Socket::handle(), and version. Referenced by Socket::connect(). |
|
setter Definition at line 941 of file Socket.d. References Socket::_blocking, Socket::handle(), Socket::sock, SOCKET_ERROR, version, and x. |
|
Definition at line 972 of file Socket.d. References Socket::_family. |
|
Definition at line 983 of file Socket.d. References Socket::sock, and SOCKET_ERROR. |
|
Definition at line 995 of file Socket.d. References Address::name(), Address::nameLen(), Socket::sock, and SOCKET_ERROR. Referenced by MulticastSocket::join(), and ServerSocket::this(). |
|
Definition at line 1007 of file Socket.d. References assert(), Socket::blocking(), Address::name(), Address::nameLen(), Socket::sock, SOCKET_ERROR, and version. Referenced by HttpClient::open(), SocketAppender::setAddress(), testClient(), testClusterServer(), testHttpClient(), testHttpClient2(), and testSocket(). |
|
need to bind() first Definition at line 1039 of file Socket.d. References Socket::sock, and SOCKET_ERROR. Referenced by ServerSocket::this(). |
|
MANGO: added Reimplemented in ServerSocket. Definition at line 1051 of file Socket.d. References Socket. Referenced by Socket::accept(). |
|
Reimplemented in ServerSocket. Definition at line 1061 of file Socket.d. References Socket::_blocking, Socket::_family, Socket::createSocket(), INVALID_SOCKET, Socket::sock, and version. Referenced by ServerSocket::accept(). |
|
Definition at line 1087 of file Socket.d. References Socket::sock. Referenced by HttpClient::close(), and Socket::shutdown(). |
|
Definition at line 1097 of file Socket.d. References Socket::shutdown(), and Socket::sock. |
|
MANGO: added Reimplemented in ServerSocket. Definition at line 1109 of file Socket.d. References Socket::setOption(). Referenced by ServerSocket::createSocket(). |
|
MANGO: added Definition at line 1127 of file Socket.d. References Socket::setOption(), and x. Referenced by MulticastSocket::join(), and ServerSocket::this(). |
|
Helper function to handle the adding and dropping of group membership. MANGO: Added Definition at line 1143 of file Socket.d. References Socket::handle(), InternetAddress::sin, and SOCKET_ERROR. |
|
calling shutdown() before this is recommended for connection- oriented sockets MANGO: changed from close() to IResource.closure() Reimplemented from Resource. Definition at line 1168 of file Socket.d. References printf(), 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 1473 of file Socket.d. References assert(). Referenced by Socket::poll(), and read(). |
|
|
|
maximum timeout |
|
Definition at line 1553 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 SocketAppender::close(), HttpClient::close(), HttpBridge::cross(), ClusterThread::run(), and testClient(). |
|
Definition at line 64 of file SocketConduit.d. Referenced by read(), and setTimeout(). |
|
Definition at line 65 of file SocketConduit.d. Referenced by read(). |
|
Definition at line 66 of file SocketConduit.d. Referenced by SocketConduit::VersionUseFreeList::closure(), and fixup(). |
|
Definition at line 67 of file SocketConduit.d. Referenced by SocketConduit::VersionUseFreeList::closure(), and fixup(). |
|
Definition at line 68 of file SocketConduit.d. Referenced by hadTimeout(), and read(). |