sasa ivkovic
/
LAN
testing of combination of LCS and LAN
HTTPServer/LPC2368/services/http/server/impl/SimpleHandler.h@0:a7a6a692162f, 2015-01-14 (annotated)
- Committer:
- damir
- Date:
- Wed Jan 14 13:29:55 2015 +0000
- Revision:
- 0:a7a6a692162f
Test of LAN
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
damir | 0:a7a6a692162f | 1 | |
damir | 0:a7a6a692162f | 2 | /* |
damir | 0:a7a6a692162f | 3 | Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com) |
damir | 0:a7a6a692162f | 4 | |
damir | 0:a7a6a692162f | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy |
damir | 0:a7a6a692162f | 6 | of this software and associated documentation files (the "Software"), to deal |
damir | 0:a7a6a692162f | 7 | in the Software without restriction, including without limitation the rights |
damir | 0:a7a6a692162f | 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
damir | 0:a7a6a692162f | 9 | copies of the Software, and to permit persons to whom the Software is |
damir | 0:a7a6a692162f | 10 | furnished to do so, subject to the following conditions: |
damir | 0:a7a6a692162f | 11 | |
damir | 0:a7a6a692162f | 12 | The above copyright notice and this permission notice shall be included in |
damir | 0:a7a6a692162f | 13 | all copies or substantial portions of the Software. |
damir | 0:a7a6a692162f | 14 | |
damir | 0:a7a6a692162f | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
damir | 0:a7a6a692162f | 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
damir | 0:a7a6a692162f | 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
damir | 0:a7a6a692162f | 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
damir | 0:a7a6a692162f | 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
damir | 0:a7a6a692162f | 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
damir | 0:a7a6a692162f | 21 | THE SOFTWARE. |
damir | 0:a7a6a692162f | 22 | */ |
damir | 0:a7a6a692162f | 23 | |
damir | 0:a7a6a692162f | 24 | #ifndef SIMPLE_HANDLER_H |
damir | 0:a7a6a692162f | 25 | #define SIMPLE_HANDLER_H |
damir | 0:a7a6a692162f | 26 | |
damir | 0:a7a6a692162f | 27 | #include "../HTTPRequestHandler.h" |
damir | 0:a7a6a692162f | 28 | |
damir | 0:a7a6a692162f | 29 | class SimpleHandler : public HTTPRequestHandler |
damir | 0:a7a6a692162f | 30 | { |
damir | 0:a7a6a692162f | 31 | public: |
damir | 0:a7a6a692162f | 32 | SimpleHandler(const char* rootPath, const char* path, TCPSocket* pTCPSocket); |
damir | 0:a7a6a692162f | 33 | virtual ~SimpleHandler(); |
damir | 0:a7a6a692162f | 34 | |
damir | 0:a7a6a692162f | 35 | //protected: |
damir | 0:a7a6a692162f | 36 | static inline HTTPRequestHandler* inst(const char* rootPath, const char* path, TCPSocket* pTCPSocket) { return new SimpleHandler(rootPath, path, pTCPSocket); } //if we ever could do static virtual functions, this would be one |
damir | 0:a7a6a692162f | 37 | |
damir | 0:a7a6a692162f | 38 | virtual void doGet(); |
damir | 0:a7a6a692162f | 39 | virtual void doPost(); |
damir | 0:a7a6a692162f | 40 | virtual void doHead(); |
damir | 0:a7a6a692162f | 41 | |
damir | 0:a7a6a692162f | 42 | virtual void onReadable(); //Data has been read |
damir | 0:a7a6a692162f | 43 | virtual void onWriteable(); //Data has been written & buf is free |
damir | 0:a7a6a692162f | 44 | virtual void onClose(); //Connection is closing |
damir | 0:a7a6a692162f | 45 | }; |
damir | 0:a7a6a692162f | 46 | |
damir | 0:a7a6a692162f | 47 | #endif |