Mercurial > archived > louis > epitech > zia-api
changeset 32:df82b7f381c0
Update EHook:
- Replace Reader, Writer, Accept, OnClose hook by NetworkModifier
Add socket_close function pointer in INetworkHandler
author | daedric <d43dr1c@gmail.com> |
---|---|
date | Sun, 21 Mar 2010 17:04:26 +0100 |
parents | d82cf6b99c5f |
children | 29df940efc3b |
files | src/include/handler/IHandler.hpp src/include/handler/INetworkHandler.hpp |
diffstat | 2 files changed, 14 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/include/handler/IHandler.hpp Sun Mar 21 15:55:16 2010 +0100 +++ b/src/include/handler/IHandler.hpp Sun Mar 21 17:04:26 2010 +0100 @@ -17,15 +17,12 @@ */ enum EHook { - AcceptConnection, /**<Used to change the accept function */ - Reader, /**<Used to change the read function */ - RequestHeaderModifier, /**<Hook to modify the request's header */ - RequestBodyModifier, /**<Hook to modify the request's body */ - ResponseProcessor, /**<Hook for content generation */ - ResponseHeaderModifier, /**<Hook to modify the response's header */ - ResponseBodyModifier, /**<Hook to modify the response's body */ - Writer, /**<Used to change the write function */ - OnConnectionClosed /**<Hook when connection is closed */ + NetwordModifier, /**<Hook to replace read/write/accept function (INetworkHandler) */ + RequestHeaderModifier, /**<Hook to modify the request's header (IHeaderHandler) */ + RequestBodyModifier, /**<Hook to modify the request's body (IBodyHandler) */ + ResponseProcessor, /**<Hook for content generation (IBodyHandler) */ + ResponseHeaderModifier, /**<Hook to modify the response's header (IHeaderHandler) */ + ResponseBodyModifier, /**<Hook to modify the response's body (IBodyHandler) */ }; /**
--- a/src/include/handler/INetworkHandler.hpp Sun Mar 21 15:55:16 2010 +0100 +++ b/src/include/handler/INetworkHandler.hpp Sun Mar 21 17:04:26 2010 +0100 @@ -61,7 +61,14 @@ ** @return the number of bytes written, -1 on error and 0 on EOF ** @see network::IEndPoint */ - int (*sock_write)(network::IEndPoint&, const void* buffer, size_t len); + int (*sock_write)(network::IEndPoint& client, const void* buffer, size_t len); + + /** + * @brief close redefinition, called when we want to close the socket + * @param [in] client Hols the client socket + * @return 0 on sucess, -1 on failure + */ + int (*sock_close)(network::IEndPoint& client); };