A stream descriptor service must meet the requirements for a descriptor
        service, as well as the additional requirements listed below.
      
        In the table below, X denotes
        a stream descriptor service class, a
        denotes a value of type X,
        b denotes a value of type
        X::implementation_type, ec
        denotes a value of type error_code,
        mb denotes a value satisfying
        mutable buffer sequence
        requirements, rh denotes
        a value meeting ReadHandler requirements, cb denotes a value satisfying constant
        buffer sequence requirements, and wh
        denotes a value meeting WriteHandler requirements.
      
Table 31. StreamDescriptorService requirements
| 
                  expression
                 | 
                  return type
                 | 
                  assertion/notepre/post-condition
 | 
| 
                  a.read_some(b,
                  mb,
                  ec); | 
                  size_t | 
                  pre: a.is_open(b).
 Reads one or more bytes of data from a descriptor
 b.
 The mutable buffer
                  sequence
 mbspecifies
                  memory where the data should be placed. The operation shall always
                  fill a buffer in the sequence completely before proceeding to the
                  next.
 If successful, returns the number of bytes read.
                  Otherwise returns
 0.
                  If the total size of all buffers in the sequencembis0,
                  the function shall return0immediately.
 If the operation completes due to graceful
                  connection closure by the peer, the operation shall fail with
 error::eof. | 
| 
                  a.async_read_some(b,
                  mb,
                  rh); | 
                  void | 
                  pre: a.is_open(b).
 Initiates an asynchronous operation to read one or more
                  bytes of data from a descriptor
 b.
                  The operation is performed via theio_serviceobjecta.get_io_service()and behaves according to asynchronous
                  operation requirements.
 The mutable buffer
                  sequence
 mbspecifies
                  memory where the data should be placed. The operation shall always
                  fill a buffer in the sequence completely before proceeding to the
                  next.
 The implementation shall maintain one or more
                  copies of
 mbuntil
                  such time as the read operation no longer requires access to the
                  memory specified by the buffers in the sequence. The program must
                  ensure the memory is valid until:
 — the last copy of
 mbis destroyed,
                  or
 — the handler for the asynchronous operation is invoked,
 
 whichever comes first. If the total size of all buffers
                  in the sequence
 mbis0, the asynchronous
                  read operation shall complete immediately and pass0as the argument to the handler
                  that specifies the number of bytes read.
 If the operation
                  completes due to graceful connection closure by the peer, the operation
                  shall fail with
 error::eof.
 If the operation completes successfully, the
 ReadHandlerobjectrhis invoked with the number
                  of bytes transferred. Otherwise it is invoked with0. | 
| 
                  a.write_some(b,
                  cb,
                  ec); | 
                  size_t | 
                  pre: a.is_open(b).
 Writes one or more bytes of data to a descriptor
 b.
 The constant
                  buffer sequence
 cbspecifies memory where the data to be written is located. The operation
                  shall always write a buffer in the sequence completely before proceeding
                  to the next.
 If successful, returns the number of
                  bytes written. Otherwise returns
 0.
                  If the total size of all buffers in the sequencecbis0,
                  the function shall return0immediately. | 
| 
                  a.async_write_some(b,
                  cb,
                  wh); | 
                  void | 
                  pre: a.is_open(b).
 Initiates an asynchronous operation to write one or more
                  bytes of data to a descriptor
 b.
                  The operation is performed via theio_serviceobjecta.get_io_service()and behaves according to asynchronous
                  operation requirements.
 The constant buffer
                  sequence
 cbspecifies
                  memory where the data to be written is located. The operation shall
                  always write a buffer in the sequence completely before proceeding
                  to the next.
 The implementation shall maintain one
                  or more copies of
 cbuntil such time as the write operation no longer requires access
                  to the memory specified by the buffers in the sequence. The program
                  must ensure the memory is valid until:
 — the last copy
                  of
 cbis destroyed,
                  or
 — the handler for the asynchronous operation is invoked,
 
 whichever comes first. If the total size of all buffers
                  in the sequence
 cbis0, the asynchronous
                  operation shall complete immediately and pass0as the argument to the handler that specifies the number of bytes
                  read.
 If the operation completes successfully, the
 WriteHandlerobjectwhis invoked with
                  the number of bytes transferred. Otherwise it is invoked with0. |