Inheritance diagram for DatagramSocket:
Public Member Functions | |
this () | |
uint | read (IBuffer target, inout Address addr) |
uint | read (IBuffer target) |
uint | write (IBuffer source, Address to) |
Private Member Functions | |
this (socket_t sock) | |
this (AddressFamily af, Type type, Protocol protocol) | |
this (ConduitStyle.Bits style, bool seekable) | |
uint | reader (void[] dst) |
uint | writer (void[] src) |
uint | bufferSize () |
void | setTimeout (uint us) |
bool | hadTimeout () |
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 | close () |
Address | remoteAddress () |
Address | localAddress () |
int | send (void[] buf, Flags flags=Flags.NONE) |
int | sendTo (void[] buf, Flags flags, Address to) |
int | sendTo (void[] buf, Address to) |
int | sendTo (void[] buf, Flags flags=Flags.NONE) |
int | receive (void[] buf, Flags flags=Flags.NONE) |
int | receiveFrom (void[] buf, Flags flags, out Address from) |
int | receiveFrom (void[] buf, out Address from) |
int | receiveFrom (void[] buf, Flags flags) |
int | receiveFrom (void[] buf) |
int | getOption (OptionLevel level, Option option, void[] result) |
void | setOption (OptionLevel level, Option option, void[] value) |
bit | poll (events) |
uint | read (void[] dst) |
uint | write (void[] src) |
Static Private Member Functions | |
static char[] | hostName () |
static uint | hostAddress () |
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) |
Note that when used with a SocketListener you must first bind the DatagramSocket to a local adapter. This can be done by binding it to an InternetAddress constructed with a port only (ADDR_ANY).
Definition at line 58 of file DatagramSocket.d.
|
Create an internet datagram socket Definition at line 66 of file DatagramSocket.d. |
|
Read the available bytes from datagram into the given IBuffer. The 'from' address will be populated appropriately Definition at line 78 of file DatagramSocket.d. References assert(). Referenced by read(). |
|
Read the available bytes from datagram into the given IBuffer. The 'from' address will be populated appropriately Reimplemented from ISocketReader. Definition at line 100 of file DatagramSocket.d. References read(). |
|
Write content from the specified buffer to the given address. Definition at line 113 of file DatagramSocket.d. References assert(). Referenced by Cluster::broadcast(). |
|
Construct a Socket from a handle. This is used internally to create new Sockets via an accept(). Reimplemented in SocketConduit. Definition at line 782 of file Socket.d. References Socket::set(), and Socket::sock. |
|
Definition at line 931 of file Socket.d. References Socket::create(), and type(). |
|
Construct a conduit with the given style and seek abilities. Conduits are either seekable or non-seekable. Reimplemented in DeviceConduit. Definition at line 104 of file Conduit.d. References Conduit::filter, Conduit::seekable, and Conduit::style. |
|
conduit-specific reader Implements Conduit. Definition at line 811 of file Socket.d. References SocketSet::add(), Socket::receive(), SocketSet::reset(), Socket::select(), Socket::ss, Socket::timeout, and Socket::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. Implements Conduit. Definition at line 855 of file Socket.d. References Socket::send(). |
|
Return a preferred size for buffering conduit I/O Reimplemented from Conduit. |
|
Set the read timeout to the specified microseconds. Set a value of zero to disable timeout support. Definition at line 881 of file Socket.d. References Socket::tv. Referenced by HttpClient::open(). |
|
Did the last operation result in a timeout? Note that this assumes there is no thread contention on this object. Definition at line 894 of file Socket.d. References Socket::timeout. |
|
MANGO: moved this out from the above constructor so that it can be called from the FreeList version of SocketConduit Definition at line 906 of file Socket.d. Referenced by SocketConduit::allocate(), and Socket::this(). |
|
MANGO: added to reset socket Definition at line 917 of file Socket.d. References INVALID_SOCKET. Referenced by SocketConduit::deallocate(). |
|
MANGO: added for multicast support Definition at line 945 of file Socket.d. References Socket::_family, Socket::sock, and type(). Referenced by ServerSocket::createSocket(), MulticastSocket::leave(), and Socket::this(). |
|
get underlying socket handle Definition at line 960 of file Socket.d. References Socket::sock. Referenced by Socket::blocking(), and Socket::setGroup(). |
|
|
|
getter Definition at line 983 of file Socket.d. References Socket::handle(), and version. Referenced by Socket::connect(). |
|
setter Definition at line 1002 of file Socket.d. References Socket::handle(), Socket::sock, SOCKET_ERROR, and version. |
|
Definition at line 1033 of file Socket.d. References Socket::_family. |
|
Definition at line 1044 of file Socket.d. References Socket::sock, SOCKET_ERROR, and type(). |
|
Definition at line 1056 of file Socket.d. References Address::name(), Address::nameLen(), Socket::sock, and SOCKET_ERROR. Referenced by MulticastSocket::join(), and ServerSocket::this(). |
|
Definition at line 1068 of file Socket.d. References assert(), Socket::blocking(), Address::name(), Address::nameLen(), Socket::sock, SOCKET_ERROR, and version. Referenced by HttpClient::open(), and SocketAppender::setAddress(). |
|
need to bind() first Definition at line 1100 of file Socket.d. References Socket::sock, and SOCKET_ERROR. Referenced by ServerSocket::this(). |
|
MANGO: added Reimplemented in ServerSocket. Definition at line 1112 of file Socket.d. References Socket. Referenced by Socket::accept(). |
|
Reimplemented in ServerSocket. Definition at line 1122 of file Socket.d. References Socket::_family, Socket::createSocket(), INVALID_SOCKET, Socket::sock, and version. Referenced by ServerSocket::accept(). |
|
Definition at line 1148 of file Socket.d. References Socket::sock. Referenced by HttpClient::close(), and Socket::shutdown(). |
|
Definition at line 1158 of file Socket.d. References Socket::shutdown(), and Socket::sock. |
|
MANGO: added Reimplemented in ServerSocket. Definition at line 1170 of file Socket.d. References Socket::setOption(). Referenced by ServerSocket::createSocket(). |
|
MANGO: added Definition at line 1188 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 1204 of file Socket.d. References Socket::handle(), InternetAddress::sin, and SOCKET_ERROR. |
|
calling shutdown() before this is recommended for connection- oriented sockets Reimplemented from Conduit. Reimplemented in SocketConduit. Definition at line 1227 of file Socket.d. References Socket::collect(). Referenced by MulticastSocket::leave(). |
|
Mango: added this to return the hostname Definition at line 1294 of file Socket.d. References SOCKET_ERROR, and strlen(). Referenced by Socket::hostAddress(). |
|
Mango: added this to return the default host address (IPv4) Definition at line 1310 of file Socket.d. References InternetHost::addrList, assert(), InternetHost::getHostByName(), and Socket::hostName(). |
|
Definition at line 1326 of file Socket.d. References Socket::_family, Address::addressFamily(), assert(), Address::name(), Address::nameLen(), Socket::newFamilyObject(), Socket::sock, and SOCKET_ERROR. Referenced by AbstractServer::getRemoteAddress(). |
|
Definition at line 1342 of file Socket.d. References Socket::_family, Address::addressFamily(), assert(), Address::name(), Address::nameLen(), Socket::newFamilyObject(), Socket::sock, and SOCKET_ERROR. Referenced by AbstractServer::getHost(), and AbstractServer::getPort(). |
|
returns number of bytes actually sent, or -1 on error Definition at line 1359 of file Socket.d. References Socket::sock. Referenced by Socket::writer(). |
|
-to- is ignored if connected ? Definition at line 1372 of file Socket.d. References Address::name(), Address::nameLen(), and Socket::sock. Referenced by Socket::sendTo(). |
|
-to- is ignored if connected ? Definition at line 1385 of file Socket.d. References Socket::sendTo(). |
|
assumes you connect()ed Definition at line 1397 of file Socket.d. References Socket::sock. |
|
returns number of bytes actually received, 0 on connection closure, or -1 on error Definition at line 1411 of file Socket.d. References Socket::sock, and SOCKET_ERROR. Referenced by Socket::reader(). |
|
-from- is ignored if connected ? Definition at line 1429 of file Socket.d. References Socket::_family, assert(), from(), Address::nameLen(), Socket::newFamilyObject(), printf(), Socket::sock, SOCKET_ERROR, and version. Referenced by Socket::receiveFrom(). |
|
-from- is ignored if connected ? Definition at line 1459 of file Socket.d. References from(), and Socket::receiveFrom(). |
|
assumes you connect()ed Definition at line 1471 of file Socket.d. References Socket::sock, and SOCKET_ERROR. |
|
assumes you connect()ed Definition at line 1489 of file Socket.d. References Socket::receiveFrom(). |
|
returns the length, in bytes, of the actual result - very different from getsockopt() Definition at line 1502 of file Socket.d. References Socket::sock, and SOCKET_ERROR. |
|
Definition at line 1516 of file Socket.d. References Socket::sock, and SOCKET_ERROR. Referenced by Socket::setAddressReuse(), Socket::setLingerPeriod(), and MulticastSocket::setLoopback(). |
|
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 1550 of file Socket.d. References assert(). Referenced by Socket::poll(), and Socket::reader(). |
|
|
|
maximum timeout |
|
Definition at line 1630 of file Socket.d. References Socket::select(). |
|
read from conduit into a target buffer Reimplemented from IConduit. Definition at line 177 of file Conduit.d. References Conduit::filter, and IConduitFilter::reader(). Referenced by DeviceConduit::VersionPosix::reader(). |
|
write to conduit from a source buffer Reimplemented from IConduit. Definition at line 188 of file Conduit.d. References Conduit::filter, and IConduitFilter::writer(). Referenced by Conduit::flush(), and DeviceConduit::VersionPosix::writer(). |