1048f6023SShuo Chen // excerpts from http://code.google.com/p/muduo/
2048f6023SShuo Chen //
3048f6023SShuo Chen // Use of this source code is governed by a BSD-style license
4048f6023SShuo Chen // that can be found in the License file.
5048f6023SShuo Chen //
6048f6023SShuo Chen // Author: Shuo Chen (chenshuo at chenshuo dot com)
7048f6023SShuo Chen 
8048f6023SShuo Chen #ifndef MUDUO_NET_CALLBACKS_H
9048f6023SShuo Chen #define MUDUO_NET_CALLBACKS_H
10048f6023SShuo Chen 
11048f6023SShuo Chen #include <boost/function.hpp>
12048f6023SShuo Chen #include <boost/shared_ptr.hpp>
13048f6023SShuo Chen 
14048f6023SShuo Chen #include "datetime/Timestamp.h"
15048f6023SShuo Chen 
16048f6023SShuo Chen namespace muduo
17048f6023SShuo Chen {
18048f6023SShuo Chen 
19048f6023SShuo Chen // All client visible callbacks go here.
20048f6023SShuo Chen 
21048f6023SShuo Chen class TcpConnection;
22048f6023SShuo Chen typedef boost::shared_ptr<TcpConnection> TcpConnectionPtr;
23048f6023SShuo Chen 
24048f6023SShuo Chen typedef boost::function<void()> TimerCallback;
25048f6023SShuo Chen typedef boost::function<void (const TcpConnectionPtr&)> ConnectionCallback;
26048f6023SShuo Chen typedef boost::function<void (const TcpConnectionPtr&,
27048f6023SShuo Chen                               const char* data,
28048f6023SShuo Chen                               ssize_t len)> MessageCallback;
29048f6023SShuo Chen+typedef boost::function<void (const TcpConnectionPtr&)> CloseCallback;
30048f6023SShuo Chen 
31048f6023SShuo Chen }
32048f6023SShuo Chen 
33048f6023SShuo Chen #endif  // MUDUO_NET_CALLBACKS_H
34