-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tangruo
committed
Sep 20, 2016
1 parent
f6f718a
commit 8285eae
Showing
94 changed files
with
5,990 additions
and
14 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#ifndef Ballet_Protocol_Http_BalHttpCallback_H | ||
#define Ballet_Protocol_Http_BalHttpCallback_H | ||
#include "Common/BalInct.h" | ||
|
||
namespace Ballet | ||
{ | ||
namespace Protocol | ||
{ | ||
enum BalHttpCallbackErrorEnum | ||
{ | ||
HttpErrorNone = 0, | ||
HttpErrorDecode = 1, | ||
HttpErrorEncode = 2, | ||
HttpErrorExceed = 3, | ||
}; | ||
|
||
class BalHttpConnection; | ||
typedef BalHandle<BalHttpConnection> BalHttpConnectionPtr; | ||
struct IBalHttpCallback :public BalCallback | ||
{ | ||
virtual bool OnConnect(BalHttpConnectionPtr conn, bool success) =0; | ||
virtual bool OnHttpBegin(BalHttpConnectionPtr conn) =0; | ||
virtual bool OnHttpHeader(BalHttpConnectionPtr conn) =0; | ||
virtual bool OnHttpBody(BalHttpConnectionPtr conn, const char* buffer, uint32_t) =0; | ||
virtual bool OnHttpComplete(BalHttpConnectionPtr conn) =0; | ||
virtual bool OnHttpError(BalHttpConnectionPtr conn, BalHttpCallbackErrorEnum error) =0; | ||
virtual bool OnHttpClose(BalHttpConnectionPtr conn, bool accord) =0; | ||
virtual void OnWriteBufferFull(BalHttpConnectionPtr conn) =0; | ||
virtual void OnWriteBufferDrain(BalHttpConnectionPtr conn) =0; | ||
}; | ||
|
||
BalCallbackSinkBegin(CBalHttpCallback) | ||
BalCallbackSink(void, OnConnect, (BalHttpConnectionPtr conn, bool success), (conn, success)) | ||
BalCallbackSink(void, OnHttpBegin, (BalHttpConnectionPtr conn), (conn)) | ||
BalCallbackSink(void, OnHttpHeader, (BalHttpConnectionPtr conn), (conn)) | ||
BalCallbackSink(void, OnHttpBody, (BalHttpConnectionPtr conn, const char* buffer, uint32_t len), (conn, buffer, len)) | ||
BalCallbackSink(void, OnHttpComplete, (BalHttpConnectionPtr conn), (conn)) | ||
BalCallbackSink(void, OnHttpError, (BalHttpConnectionPtr conn, BalHttpCallbackErrorEnum error), (conn, error)) | ||
BalCallbackSink(void, OnHttpClose, (BalHttpConnectionPtr conn, bool accord), (conn, accord)) | ||
BalCallbackSink(void, OnWriteBufferFull, (BalHttpConnectionPtr conn), (conn)) | ||
BalCallbackSink(void, OnWriteBufferDrain, (BalHttpConnectionPtr conn), (conn)) | ||
BalCallbackSinkComplete() | ||
BalCallbackSinkPtrDefine(CBalHttpCallback, IBalHttpCallback) | ||
} | ||
} | ||
#endif//Ballet_Protocol_Http_BalHttpCallback_H |
Empty file.
Empty file.
Oops, something went wrong.