Jun Furutani / libMiMic

Fork of libMiMic by Ryo Iizuka

Committer:
nyatla
Date:
Sat Apr 27 13:31:57 2013 +0000
Revision:
19:33b9ba0859ee
Parent:
17:f29e1ca90e3d
Child:
45:63d6aa80e26d
update MiMic core r223;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nyatla 3:0a94993be1f6 1 #include "Httpd.h"
nyatla 3:0a94993be1f6 2 #include "HttpdConnection.h"
nyatla 3:0a94993be1f6 3 namespace MiMic
nyatla 3:0a94993be1f6 4 {
nyatla 19:33b9ba0859ee 5 char Httpd::_shared_buf[SIZE_OF_HTTP_BUF];
nyatla 19:33b9ba0859ee 6
nyatla 3:0a94993be1f6 7 void Httpd::onRequestHandler(NyLPC_TcHttpdConnection_t* i_connection)
nyatla 3:0a94993be1f6 8 {
nyatla 3:0a94993be1f6 9 HttpdConnection c(i_connection);
nyatla 3:0a94993be1f6 10 ((struct Httpd2*)(i_connection->_parent_httpd))->_parent->onRequest(c);
nyatla 3:0a94993be1f6 11 }
nyatla 3:0a94993be1f6 12 Httpd::Httpd(int i_port_number)
nyatla 3:0a94993be1f6 13 {
nyatla 3:0a94993be1f6 14 NyLPC_cHttpd_initialize((NyLPC_TcHttpd_t*)(&this->_inst),(NyLPC_TUInt16)i_port_number);
nyatla 3:0a94993be1f6 15 this->_inst._parent=this;
nyatla 3:0a94993be1f6 16 this->_inst.super.function.onRequest=onRequestHandler;
nyatla 3:0a94993be1f6 17 }
nyatla 3:0a94993be1f6 18 Httpd::~Httpd()
nyatla 3:0a94993be1f6 19 {
nyatla 3:0a94993be1f6 20 NyLPC_cHttpd_finalize((NyLPC_TcHttpd_t*)(&this->_inst));
nyatla 3:0a94993be1f6 21 }
nyatla 3:0a94993be1f6 22 void Httpd::loop()
nyatla 3:0a94993be1f6 23 {
nyatla 3:0a94993be1f6 24 NyLPC_cHttpd_loop((NyLPC_TcHttpd_t*)(&this->_inst));
nyatla 3:0a94993be1f6 25 }
nyatla 19:33b9ba0859ee 26 void Httpd::lock()
nyatla 19:33b9ba0859ee 27 {
nyatla 19:33b9ba0859ee 28 NyLPC_cHttpd_lock((NyLPC_TcHttpd_t*)(&this->_inst));
nyatla 19:33b9ba0859ee 29 }
nyatla 19:33b9ba0859ee 30 void Httpd::unlock()
nyatla 19:33b9ba0859ee 31 {
nyatla 19:33b9ba0859ee 32 NyLPC_cHttpd_unlock((NyLPC_TcHttpd_t*)(&this->_inst));
nyatla 19:33b9ba0859ee 33 }
nyatla 19:33b9ba0859ee 34
nyatla 3:0a94993be1f6 35 }