the_Foundation 1.0
|
Enumerations | |
enum | iSocketStatus { addressLookup_SocketStatus , initialized_SocketStatus , connecting_SocketStatus , connected_SocketStatus , disconnecting_SocketStatus , disconnected_SocketStatus } |
TCP socket.
Socket is a bidirectional non-random-access Stream where data gets written by a background I/O thread.
Every time something gets written to the Socket's output buffer, the I/O thread is woken up and the pending data is sent. You may wish to use another Buffer to queue up data to send in larger chunks.
Socket is derived from Stream, so all Stream methods can be used on it for writing and reading data. Both reading and writing is non-blocking. When writing, a copy of the data is made into an internal buffer for the I/O thread. When reading, only data already received and waiting in the input buffer will be returned. To wait for incoming data you can join the readyRead
audience.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.