Generic SocketHandle with client interface. More...

#include <senf/Socket/ClientSocketHandle.hh>

Inheritance diagram for senf::ClientSocketHandle< SPolicy >:

Public Types

typedef SPolicy::AddressingPolicy::Address Address
 Address type from the addressing policy. More...
 
typedef boost::call_traits< Address >::param_type AddressParam
 'Best' type for passing address as parameter More...
 
typedef ServerSocketHandle< SPolicy > ServerHandle
 Corresponding server socket handle with the same policy. More...
 
- Public Types inherited from senf::SocketHandle< SPolicy >
typedef SPolicy Policy
 

Public Member Functions

void state (SocketStateMap &map, unsigned lod=0)
 
std::string dumpState (unsigned lod=0)
 
unsigned available ()
 
- Public Member Functions inherited from senf::SocketHandle< SPolicy >
template<class OtherPolicy >
IsCompatible< OtherPolicy >::type const & operator= (SocketHandle< OtherPolicy > other)
 Assign from other socket handle checking policy compatibility. More...
 
void state (SocketStateMap &map, unsigned lod=0)
 Inquire state information of socket handle. More...
 
std::string dumpState (unsigned lod=0)
 Format complete state information as string. More...
 
template<class Facet >
Facet & facet ()
 Access a protocol facet. More...
 
 SocketHandle ()
 
template<class OtherPolicy >
 SocketHandle (SocketHandle< OtherPolicy > other, typename IsCompatible< OtherPolicy >::type *=0)
 Convert from other socket handle checking policy compatibility. More...
 
- Public Member Functions inherited from senf::FileHandle
void close ()
 Close filehandle. More...
 
void terminate ()
 Close filehandle ignoring error conditions. More...
 
bool readable () const
 Check, whether a read on the handle would not block (ignoring blocking state) More...
 
bool waitReadable (senf::ClockService::clock_type timeout=senf::ClockService::clock_type(-1)) const
 Wait, until read on the handle would not block (ignoring blocking state) More...
 
bool writeable () const
 Check, whether a write on the handle would not block (ignoring blocking state) More...
 
bool waitWriteable (senf::ClockService::clock_type timeout=senf::ClockService::clock_type(-1)) const
 Wait, until a write on the handle would not block (ignoring blocking state) More...
 
bool oobReadable () const
 Check, whether a read of prioritized data on the handle would not block (ignoring blocking state) More...
 
bool waitOOBReadable (senf::ClockService::clock_type timeout=senf::ClockService::clock_type(-1)) const
 Wait, until read of prioritized data on the handle does not block (ignoring blocking state) More...
 
bool blocking () const
 Return current blocking state. More...
 
void blocking (bool status)
 Set blocking state. More...
 
bool eof () const
 Check EOF condition. More...
 
bool valid () const
 Check filehandle validity. More...
 
bool boolean_test () const
 Short for valid() && ! eof() More...
 
int fd () const
 Return the raw FileHandle. More...
 
int refcount () const
 
bool is_shared () const
 
 FileHandle ()
 
 ~FileHandle ()
 
- Public Member Functions inherited from senf::comparable_safe_bool< class >
 operator bool_type () const
 
bool operator! () const
 

Static Public Member Functions

static ClientSocketHandle cast_static (FileHandle handle)
 
static ClientSocketHandle cast_dynamic (FileHandle handle)
 
- Static Public Member Functions inherited from senf::SocketHandle< SPolicy >
static SocketHandle cast_static (FileHandle handle)
 
static SocketHandle cast_dynamic (FileHandle handle)
 
- Static Public Member Functions inherited from senf::FileHandle
static FileHandle cast_static (FileHandle handle)
 
static FileHandle cast_dynamic (FileHandle handle)
 

Protected Member Functions

 ClientSocketHandle (FileHandle other, bool isChecked)
 
 ClientSocketHandle (std::unique_ptr< SocketBody > body)
 
- Protected Member Functions inherited from senf::SocketHandle< SPolicy >
 SocketHandle (std::unique_ptr< SocketBody > body)
 Initialize SocketHandle providing the protocol. More...
 
 SocketHandle (FileHandle other, bool isChecked)
 Initialize SocketHandle from arbitrary checked FileHandle. More...
 
SocketBody & body ()
 Access socket body. More...
 
SocketBody const & body () const
 Access socket body in const context. More...
 
SocketProtocolprotocol () const
 Access protocol class. More...
 
void assign (FileHandle other)
 
- Protected Member Functions inherited from senf::FileHandle
 FileHandle (std::unique_ptr< FileBody > body)
 create new FileHandle instance More...
 
 FileHandle (FileBody::ptr body)
 
FileBodybody ()
 Access body. More...
 
FileBody const & body () const
 Access body in const context. More...
 
void fd (int fd)
 Set raw filehandle. More...
 
void * extraPtr () const
 get extra data pointer More...
 
void extraPtr (void *ptr)
 set extra data pointer More...
 
- Protected Member Functions inherited from senf::comparable_safe_bool< class >
 ~comparable_safe_bool ()
 
- Protected Member Functions inherited from senf::safe_bool_base
void this_type_does_not_support_comparisons () const
 
 safe_bool_base ()
 
 safe_bool_base (const safe_bool_base &)
 
safe_bool_baseoperator= (const safe_bool_base &)
 
 ~safe_bool_base ()
 

Structors and default members

 ClientSocketHandle ()
 
 ClientSocketHandle (ClientSocketHandle< OtherPolicy > other)
 
template<class OtherPolicy >
ClientSocketHandle< OtherPolicy > const & operator= (ClientSocketHandle< OtherPolicy > other)
 

Reading and Writing

std::string read (unsigned limit=0)
 Read data from socket. More...
 
template<class ForwardWritableRange >
boost::range_iterator< ForwardWritableRange >::type read (ForwardWritableRange const &range)
 Read data into range. More...
 
template<class ForwardWritableRange >
boost::range_iterator< ForwardWritableRange >::type read (ForwardWritableRange &range)
 Read data into range. More...
 
template<class Sequence >
void read (Sequence &container, unsigned limit)
 Read data into container. More...
 
char * read (char *start, char *end)
 Read data into memory area. More...
 
std::pair< std::string, Addressreadfrom (unsigned limit=0)
 Read data from unconnected socket returning address. More...
 
template<class ForwardWritableRange >
boost::range_iterator< ForwardWritableRange const >::type readfrom (ForwardWritableRange const &range, Address &from)
 Read data into range. More...
 
template<class ForwardWritableRange >
boost::range_iterator< ForwardWritableRange >::type readfrom (ForwardWritableRange &range, Address &from)
 Read data into range. More...
 
template<class Sequence >
void readfrom (Sequence &container, Address &from, unsigned limit)
 Read data into container. More...
 
char * readfrom (char *start, char *end, Address &from)
 Read data into memory buffer. More...
 
template<class ForwardReadableRange >
boost::range_const_iterator< ForwardReadableRange const >::type write (ForwardReadableRange const &range)
 Write data to socket. More...
 
char const * write (char const *start, char const *end)
 Write data to socket from memory buffer. More...
 
template<class ForwardReadableRange >
boost::range_const_iterator< ForwardReadableRange const >::type writeto (AddressParam addr, ForwardReadableRange const &range)
 Write data to unconnected socket. More...
 
char const * writeto (AddressParam addr, char const *start, char const *end)
 Write data from memory buffer to unconnected socket. More...
 

Queue based Reading and Writing

boost::optional< typename SPolicy::ReadPolicy::Buffer > dequeue ()
 Read data from packet queue. More...
 
void release ()
 Release all queue frames to the kernel. More...
 
boost::optional< typename SPolicy::WritePolicy::Buffer > enqueue ()
 Write data to packet queue. More...
 
bool send ()
 Send all data in the write queue. More...
 

Addressing

void connect (AddressParam addr) const
 Connect to remote peer. More...
 
void bind (AddressParam addr) const
 Set local address. More...
 
Address peer () const
 Query remote address. More...
 
void peer (Address &addr) const
 Query remote address. More...
 
Address local () const
 Query local address. More...
 
void local (Address &addr) const
 Query local address. More...
 

Additional Inherited Members

- Protected Types inherited from senf::safe_bool_base
typedef void(safe_bool_base::* bool_type) () const
 
- Static Protected Member Functions inherited from senf::FileHandle
static FileBodybody (FileHandle &handle)
 Access body of another FileHandle instance. More...
 
static FileBody const & body (FileHandle const &handle)
 Access body of another FileHandle instance in const context. More...
 

Detailed Description

template<class SPolicy>
class senf::ClientSocketHandle< SPolicy >

Generic SocketHandle with client interface.

This class provides the client side policy interface of the socket abstraction. ClientSocketHandle defines the complete policy interface. It does not implement any functionality itself however. The following table shows, to which policy members each group of ClientSocketHandle members is forwarded. The last column shows, on which other policies this member-group depends in the default policy classes. If you define your own policy classes, the dependencies are up to you.

ClientSocketHandle member Policy member Other policies
read() ReadPolicy::read (senf::ReadPolicyBase)
readfrom() ReadPolicy::readfrom (senf::ReadPolicyBase) UnconnectedCommunicationPolicy
write() WritePolicy::write (senf::WritePolicyBase) ConnectedCommunicationPolicy
writeto() WritePolicy::writeto (senf::WritePolicyBase) UnconnectedCommunicationPolicy
connect() AddressingPolicy::connect (senf::AddressingPolicyBase)
bind() AddressingPolicy::bind (senf::AddressingPolicyBase)
peer() AddressingPolicy::peer (senf::AddressingPolicyBase)
local() AddressingPolicy::local (senf::AddressingPolicyBase)
dequeue() ReadPolicy::dequeue (senf::ReadPolicyBase)
release() ReadPolicy::release (senf::ReadPolicyBase)
enqueue() WritePolicy::release (senf::WritePolicyBase)
send() WritePolicy::send (senf::WritePolicyBase)

It is important to note, that not all members are always accessible. Which are depends on the Policy template argument. If any of the policy axis is left unspecified the corresponding members will not be callable (you will get a compile time error). Even if every policy axis is defined, some members might (and will) not exist if they are meaningless for the protocol of the socket. This depends on the exact policy.

To find out, which members are available, you have to check the documentation of the policy classes. You can also find a summary of all members available in the leaf protocol class documentation.

The last set of members is special: it provides an alternative read/write implementation available only on special handles supporting the QueueReadPolicy and/or QueueWritePolicy.

Todo:
Move all not template-parameter dependent code into a non-template base class
Idea:
Give SocketHandle (and therefore ClientSocketHandle and ServerSocketHandle) a protocol() template member and an additional template arg Policies. This arg should be a typelist of policy classes which can be accessed. You use protocol<ProtocolClass>() to access a protocol class. Policies can of course be underspecified or even empty.
See also
The Policy Framework
The Protocol Classes

Definition at line 88 of file ClientSocketHandle.hh.

Member Typedef Documentation

◆ Address

template<class SPolicy>
typedef SPolicy::AddressingPolicy::Address senf::ClientSocketHandle< SPolicy >::Address

Address type from the addressing policy.

Definition at line 96 of file ClientSocketHandle.hh.

◆ AddressParam

template<class SPolicy>
typedef boost::call_traits<Address>::param_type senf::ClientSocketHandle< SPolicy >::AddressParam

'Best' type for passing address as parameter

Depending on the type of Address, this will be either Address or Address const &. See call_traits documentation in the Boost.Utility library.

Definition at line 103 of file ClientSocketHandle.hh.

◆ ServerHandle

template<class SPolicy>
typedef ServerSocketHandle<SPolicy> senf::ClientSocketHandle< SPolicy >::ServerHandle

Corresponding server socket handle with the same policy.

This class will probably only be usable, if the CommunicationPolicy is ConnectedCommunicationPolicy and the AddressingPolicy is not NoAddressingPolicy.

Definition at line 108 of file ClientSocketHandle.hh.

Constructor & Destructor Documentation

◆ ClientSocketHandle() [1/4]

template<class SPolicy>
senf::ClientSocketHandle< SPolicy >::ClientSocketHandle ( )

◆ ClientSocketHandle() [2/4]

template<class SPolicy>
senf::ClientSocketHandle< SPolicy >::ClientSocketHandle ( ClientSocketHandle< OtherPolicy >  other)

◆ ClientSocketHandle() [3/4]

template<class SPolicy>
senf::ClientSocketHandle< SPolicy >::ClientSocketHandle ( FileHandle  other,
bool  isChecked 
)
protected

◆ ClientSocketHandle() [4/4]

template<class SPolicy>
senf::ClientSocketHandle< SPolicy >::ClientSocketHandle ( std::unique_ptr< SocketBody >  body)
explicitprotected

Member Function Documentation

◆ available()

template<class SPolicy>
unsigned senf::ClientSocketHandle< SPolicy >::available ( )

◆ bind()

template<class SPolicy>
void senf::ClientSocketHandle< SPolicy >::bind ( AddressParam  addr) const

Set local address.

For addressable protocols (AddressingPolicy is not NoAddressingPolicy), bind() will set the local address of the socket.

Parameters
[in]addrLocal socket address to assign
Exceptions
senf::SystemException

◆ cast_dynamic()

template<class SPolicy>
static ClientSocketHandle senf::ClientSocketHandle< SPolicy >::cast_dynamic ( FileHandle  handle)
static

◆ cast_static()

template<class SPolicy>
static ClientSocketHandle senf::ClientSocketHandle< SPolicy >::cast_static ( FileHandle  handle)
static

◆ connect()

template<class SPolicy>
void senf::ClientSocketHandle< SPolicy >::connect ( AddressParam  addr) const

Connect to remote peer.

This member will establish a connection for addressable connection-oriented protocols (that is, the CommunicationPolicy is ConnectedCommunicationPolicy and the AddressingPolicy is not NoAddressingPolicy).

Parameters
[in]addrAddress to connect to
Exceptions
senf::SystemException

◆ dequeue()

template<class SPolicy>
boost::optional<typename SPolicy::ReadPolicy::Buffer> senf::ClientSocketHandle< SPolicy >::dequeue ( )

Read data from packet queue.

Some protocols support a more efficient queue based read/write protocol. If the handle supports this protocol, dequeue() and release() are used to read packets from that queue.

The API works as follows:

  • calling dequeue() will return a buffer object pointing to the packet data in the read queue.
  • to release the memory returned by dequeue(), call release(). This call will return all unreleased frames to the kernel.

The API has some special features:

  • the API is always non-blocking
  • you must release() all data back to the kernel before re-entering the scheduler. Otherwise, the file handle will be signaled again immediately.
  • even if the handle is marked readable dequeue() might return boost::none.
Returns
iterator range to the data frame or boost::none, if no data is available
Implementation note:
the reason, dequeue() might return boost::none even if readable is, that on a packet socket handle outgoing data is sent to the socket but is filtered in dequeue()

◆ dumpState()

template<class SPolicy>
std::string senf::ClientSocketHandle< SPolicy >::dumpState ( unsigned  lod = 0)

◆ enqueue()

template<class SPolicy>
boost::optional<typename SPolicy::WritePolicy::Buffer> senf::ClientSocketHandle< SPolicy >::enqueue ( )

Write data to packet queue.

Some protocols support a more efficient queue based read/write protocol. If the handle supports this protocol, enqueue() and release() are used to write packets to that queue.

The API works as follows:

  • calling enqueue() will return an buffer object pointing to a new queue entry.
  • now write the data frame to that area (e.g. memcpy the packet there or construct a new packet in the memory area using the external packet memory management support)
  • you mast call resize() on the buffer object to set the size of the packet to be sent
  • call send() to send all packets allocated from the send queue since the last call call to send()

The API has some special features:

  • you may call enqueue() several times before calling send()
  • a call to send() will send out all packets allocated since the last call to send()
  • it is possible for the call to enqueue() to fail if no space is available in the send queue
Returns
iterator range to the write queue buffer or boost::none, if there is no room in the write queue.
Warning
You must ensure to call bufffer.resize() on all packets you enqueue() before calling send()

◆ local() [1/2]

template<class SPolicy>
Address senf::ClientSocketHandle< SPolicy >::local ( ) const

Query local address.

This member will return the address of the local socket in addressable protocols (AddressingPolicy is not NoAddressingPolicy).

There are two Variants of this member, one will return the address by value, the other takes a reference argument to elide the copy operation.

Exceptions
senf::SystemException

◆ local() [2/2]

template<class SPolicy>
void senf::ClientSocketHandle< SPolicy >::local ( Address addr) const

Query local address.

See also
local()

◆ operator=()

template<class SPolicy>
template<class OtherPolicy >
ClientSocketHandle<OtherPolicy> const& senf::ClientSocketHandle< SPolicy >::operator= ( ClientSocketHandle< OtherPolicy >  other)

◆ peer() [1/2]

template<class SPolicy>
Address senf::ClientSocketHandle< SPolicy >::peer ( ) const

Query remote address.

This member will return the address of the communication partner in addressable connection-oriented protocols (that is, the CommunicationPolicy is ConnectedCommunicationPolicy and the AddressingPolicy is not NoAddressingPolicy).

There are two Variants of this member, one will return the address by value, the other takes a reference argument to elide the copy operation.

Exceptions
senf::SystemException

◆ peer() [2/2]

template<class SPolicy>
void senf::ClientSocketHandle< SPolicy >::peer ( Address addr) const

Query remote address.

See also
peer()

◆ read() [1/5]

template<class SPolicy>
std::string senf::ClientSocketHandle< SPolicy >::read ( unsigned  limit = 0)

Read data from socket.

If the sockets FramingPolicy is DatagramFramingPolicy, every read() command will return a single datagram. If the sockets FramingPolicy is StreamFraming, the operation will return as much data as possible from the socket buffer. However it cannot be guaranteed, that the socket buffer will be empty after read() returns.

Attention
If the space available for the data read is limited, the read will return no more than that amount of data. For a datagram socket, a full datagram is still dequeued from the socket buffer, the remainder of the datagram will be lost.

There are several variants of read which differ in how they return the read string.

If the further document doesn't tell something differently, on a blocking socket the members will always return some data (as long as the socket has not been closed at the other end) and will block, if no data is available now. If you do not want to block, you must make the socket non-blocking (using FileHandle::blocking()).

Exceptions
senf::SystemException

This variant will read up to limit bytes from the socket and return them as a std::string object.

Parameters
[in]limitMaximum number of bytes to read or 0 if unlimited.
Returns
data read
Implementation note:
The read() family of members will use standard POSIX read calls, not recv.

◆ read() [2/5]

template<class SPolicy>
template<class ForwardWritableRange >
boost::range_iterator<ForwardWritableRange>::type senf::ClientSocketHandle< SPolicy >::read ( ForwardWritableRange const &  range)

Read data into range.

Read data into the given range. At most boost::size(range) characters are read. The data read will start at the beginning of the range. read returns a past-the-end iterator after the last character read. This iterator will point to somewhere within the input range.

Parameters
[in,out]rangeRange to store data in
Returns
past-the-end iterator pointer to after the last read character
See also
read()
Boost.Range

◆ read() [3/5]

template<class SPolicy>
template<class ForwardWritableRange >
boost::range_iterator<ForwardWritableRange>::type senf::ClientSocketHandle< SPolicy >::read ( ForwardWritableRange &  range)

Read data into range.

See also
read(ForwardWritableRange const &)
read()
Boost.Range

◆ read() [4/5]

template<class SPolicy>
template<class Sequence >
void senf::ClientSocketHandle< SPolicy >::read ( Sequence &  container,
unsigned  limit 
)

Read data into container.

The data read is written into the given container. Old data in the container will be removed. For this to work, the container must be a model of 'Sequence' as defined in the STL documentation

Parameters
[out]containerContainer to write data to
[in]limitMaximum number of characters to read
See also
read()

◆ read() [5/5]

template<class SPolicy>
char* senf::ClientSocketHandle< SPolicy >::read ( char *  start,
char *  end 
)

Read data into memory area.

This variant will read data into the memory area from start to before end. This is guaranteed to be the most efficient version of read().

Parameters
[in]startaddress of buffer to store data at
[in]endaddress one past the end of the buffer
Returns
pointer past the end of the data read
See also
read()

◆ readfrom() [1/5]

template<class SPolicy>
std::pair<std::string, Address> senf::ClientSocketHandle< SPolicy >::readfrom ( unsigned  limit = 0)

Read data from unconnected socket returning address.

The readfrom() group of member behaves like read() but should only be available, if the sockets CommunicationPolicy is UnconnectedCommunicationPolicy and the AddressingPolicy is not NoAddressingPolicy. readfrom() will in addition to the data return the address of the sender.

Exceptions
senf::SystemException

This variant will return the data read and the address as a std::pair.

Returns
std::pair of data read (a string) and the peers address
Implementation note:
The readfrom() family of members will use recvfrom from the BSD socket API.

◆ readfrom() [2/5]

template<class SPolicy>
template<class ForwardWritableRange >
boost::range_iterator<ForwardWritableRange const>::type senf::ClientSocketHandle< SPolicy >::readfrom ( ForwardWritableRange const &  range,
Address from 
)

Read data into range.

Read data into the given range. At most boost::size(range) characters are read. The data read will start at the beginning of the range. read returns a past-the-end iterator after the last character read. This iterator will point to somewhere within the input range.

Parameters
[in,out]rangeRange to store data in
[out]frompeers address from which the data was received
Returns
past-the-end iterator pointer to after the last read character
See also
readfrom()
Boost.Range

◆ readfrom() [3/5]

template<class SPolicy>
template<class ForwardWritableRange >
boost::range_iterator<ForwardWritableRange>::type senf::ClientSocketHandle< SPolicy >::readfrom ( ForwardWritableRange &  range,
Address from 
)

◆ readfrom() [4/5]

template<class SPolicy>
template<class Sequence >
void senf::ClientSocketHandle< SPolicy >::readfrom ( Sequence &  container,
Address from,
unsigned  limit 
)

Read data into container.

The data read is written into the given container. Old data in the container will be removed. For this to work, the container must be a model of 'Sequence' as defined in the STL documentation

Parameters
[out]containerContainer to write data to
[in]limitMaximum number of characters to read
[out]frompeers address from which the data was received
See also
readfrom()

◆ readfrom() [5/5]

template<class SPolicy>
char* senf::ClientSocketHandle< SPolicy >::readfrom ( char *  start,
char *  end,
Address from 
)

Read data into memory buffer.

This variant will read data into the memory area from start to before end. This is guaranteed to be the most efficient version of readfrom().

Parameters
[in]startaddress of buffer to store data at
[in]endaddress one past the end of the buffer
[out]frompeers address from which the data was received
Returns
pointer past the end of the data read
See also
read()

◆ release()

template<class SPolicy>
void senf::ClientSocketHandle< SPolicy >::release ( )

Release all queue frames to the kernel.

All the frames dequeued since the last call to release() will be returned to kernel space.

◆ send()

template<class SPolicy>
bool senf::ClientSocketHandle< SPolicy >::send ( )

Send all data in the write queue.

This call will send out all frames allocated since the last call to send().

◆ state()

template<class SPolicy>
void senf::ClientSocketHandle< SPolicy >::state ( SocketStateMap &  map,
unsigned  lod = 0 
)

◆ write() [1/2]

template<class SPolicy>
template<class ForwardReadableRange >
boost::range_const_iterator<ForwardReadableRange const>::type senf::ClientSocketHandle< SPolicy >::write ( ForwardReadableRange const &  range)

Write data to socket.

The write() family of members will write out the data to the socket. If the sockets FramingPolicy is DatagramFramingPolicy, every write() call will result in one datagram.

A single write call might depending on the circumstances write only part of the data.

There are two variants of this member

Exceptions
senf::SystemException

This variant will write out the range data.

Parameters
[in]rangeData to write
Returns
past-the-end iterator after last element written
Implementation note:
The write() family of members will use POSIX write calls, not send.

◆ write() [2/2]

template<class SPolicy>
char const* senf::ClientSocketHandle< SPolicy >::write ( char const *  start,
char const *  end 
)

Write data to socket from memory buffer.

Parameters
[in]startbeginning of area to write
[in]endpast-the-end pointer to area to write
Returns
past-the-end pointer after last byte written
See also
write()
Boost.Range

◆ writeto() [1/2]

template<class SPolicy>
template<class ForwardReadableRange >
boost::range_const_iterator<ForwardReadableRange const>::type senf::ClientSocketHandle< SPolicy >::writeto ( AddressParam  addr,
ForwardReadableRange const &  range 
)

Write data to unconnected socket.

This member behaves like write() but should only be available, if the sockets CommunicationPolicy is UnconnectedCommunicationPolicy and the AddressingPolicy is not NoAddressingPolicy. The writeto() family of members takes the target address as an additional argument.

There are two variants of this member.

Exceptions
senf::SystemException

This variant will send the range range to peer addr.

Parameters
[in]addrAddress of peer to send data to
[in]rangedata to send
Returns
Number of bytes written

◆ writeto() [2/2]

template<class SPolicy>
char const* senf::ClientSocketHandle< SPolicy >::writeto ( AddressParam  addr,
char const *  start,
char const *  end 
)

Write data from memory buffer to unconnected socket.

Parameters
[in]addrAddress of peer to send data to
[in]startaddress of buffer to write
[in]endpast-the-end pointer after data to write
Returns
past-the-end iterator after last byte written
See also
writeto()
Boost.Range

The documentation for this class was generated from the following file: