[Home]BoostSocket/AsynchSocketBase

BOOST WIKI | BoostSocket | RecentChanges | Preferences | Page List | Links List

Difference (from prior major revision) (no other diffs)

Changed: 1,168c1,36

AsynchSocketBase concept




Try to describe a socket_base class for platform neutral asynchrounous socket operations:

The AsynchSocketBase is a refinement of the SocketBaseConcept, adding these signatures:

template <class Addr> void async_accept(
AsynchSocketBase& socket,
Addr& address,
boost::function<void(AsynchSocketBase&,SocketError?> completionRoutine);

template <class Addr> void async_connect(
const Addr& address,
boost::function<void(AsynchSocketBase&,SocketError?> completionRoutine);

void async_recv(
void* data, int len,
boost::function<void(AsynchSocketBase&,SocketError?,unsigned int)> completionRoutine);

void async_send(
const void* data, int len, b
boost::function<void(AsynchSocketBase&,SocketError?,unsigned int)> completionRoutine);

void async_close(
boost::function<void(AsynchSocketBase&, SocketError?)> completionRoutine);

To receive callbacks and completions the AsynchSocketBase has to attach to an AsynchProactor the completions will be dequed and dispatched by the dispatch method of the AsynchProactor.

Should we provide and support, async_connect, async_accept (are these easily and efficiently implementable in Unix/Linux? MacOS? and Windows and which versions).
* Windows
** async_connect - ConnectEx is supported in XP and later
** async_accept - AcceptEx supported in NT 3.51 and later (unsuported in Win95/98/ME)

Questions



* How to handle platform differences? (Implement in terms of boost.threads and simpler blocking/non blocking operations and select, could be innefficient)
* Should the AsynchSocketBase& socket_t be in the boost::function callback signature or is it up to the user to supply and bind them if needed.

AsynchSocketBase concept

Try to describe a socket_base class for platform neutral asynchrounous socket operations:

The AsynchSocketBase is a refinement of the SocketBaseConcept, adding these signatures:

 template <class Addr> void async_accept(
      AsynchSocketBase& socket,
      Addr& address, 
      boost::function<void(AsynchSocketBase&,SocketError?> completionRoutine);

 template <class Addr> void async_connect(
     const Addr& address,
     boost::function<void(AsynchSocketBase&,SocketError?> completionRoutine);

 void async_recv(
     void* data, int len, 
     boost::function<void(AsynchSocketBase&,SocketError?,unsigned  int)> completionRoutine);

 void async_send(
    const void* data, int len, b
    boost::function<void(AsynchSocketBase&,SocketError?,unsigned int)> completionRoutine);

 void async_close(
    boost::function<void(AsynchSocketBase&, SocketError?)> completionRoutine);

To receive callbacks and completions the AsynchSocketBase has to attach to an AsynchProactor the completions will be dequed and dispatched by the dispatch method of the AsynchProactor.

Should we provide and support, async_connect, async_accept (are these easily and efficiently implementable in Unix/Linux? MacOS? and Windows and which versions).

Questions


BOOST WIKI | BoostSocket | RecentChanges | Preferences | Page List | Links List
Edit text of this page | View other revisions
Last edited December 18, 2004 12:30 pm (diff)
Search:
Disclaimer: This site not officially maintained by Boost Developers