static private int EventHandler(MongooseEvent ev) { if (ev.type != 1) { return 0; // Mark as unhandled } MongooseRequestInfo request_info = (MongooseRequestInfo) Marshal.PtrToStructure(ev.request_info, typeof(MongooseRequestInfo)); if (request_info.uri != "/test") { return 0; // Mark as unhandled } Mongoose.write(ev.conn, "HTTP/1.1 200 OK\r\n\r\n"); Mongoose.write(ev.conn, "Hello from C#!\n"); return 1; // Mark as handled }
static private int EventHandler(MongooseEvent ev) { if (ev.type != 1) { return(0); // Mark as unhandled } MongooseRequestInfo request_info = (MongooseRequestInfo) Marshal.PtrToStructure(ev.request_info, typeof(MongooseRequestInfo)); if (request_info.uri != "/test") { return(0); // Mark as unhandled } Mongoose.write(ev.conn, "HTTP/1.1 200 OK\r\n\r\n"); Mongoose.write(ev.conn, "Hello from C#!\n"); return(1); // Mark as handled }