diff options
author | 2015-11-04 18:55:36 +0100 | |
---|---|---|
committer | 2015-11-04 18:55:36 +0100 | |
commit | b6707c3bb53c931e9ec3c5c6630149b7121bbcf5 (patch) | |
tree | 2d9c880bb21242c3fb4619977fe9a71658b3d06e /3rdparty/mongoose/examples/csharp/example.cs | |
parent | 2a067f08a4582cdff841dc27b661a9e48fac419a (diff) |
Removed mongoose due to restricted license and webserver wip till code is restructured (nw)
Diffstat (limited to '3rdparty/mongoose/examples/csharp/example.cs')
-rw-r--r-- | 3rdparty/mongoose/examples/csharp/example.cs | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/3rdparty/mongoose/examples/csharp/example.cs b/3rdparty/mongoose/examples/csharp/example.cs deleted file mode 100644 index 9736c6b991d..00000000000 --- a/3rdparty/mongoose/examples/csharp/example.cs +++ /dev/null @@ -1,43 +0,0 @@ -// This file is part of mongoose web server project, -// https://github.com/cesanta/mongoose - -using System; - -public class Program { - static private int EventHandler(IntPtr conn_ptr, int ev) { - MongooseConnection conn = (MongooseConnection) - System.Runtime.InteropServices.Marshal.PtrToStructure( - conn_ptr , typeof(MongooseConnection)); - - if (ev == 102) { - // MG_AUTH - return 1; - } else if (ev == 103) { - // MG_REQUEST - Mongoose.send_data(conn_ptr, "Hello from C#!\n"); - Mongoose.send_data(conn_ptr, "URI: " + conn.uri + "\n"); - Mongoose.send_data(conn_ptr, "HTTP Headers:\n"); - - for (int i = 0; i < conn.num_headers; i++) { - IntPtr name = conn.http_headers[i].name; - IntPtr val = conn.http_headers[i].value; - System.Runtime.InteropServices.Marshal.PtrToStringAnsi(name); - Mongoose.send_data(conn_ptr, " " + - System.Runtime.InteropServices.Marshal.PtrToStringAnsi(name) + ": " + - System.Runtime.InteropServices.Marshal.PtrToStringAnsi(val) + "\n"); - } - return 1; - } - return 0; - } - - static void Main() { - Mongoose web_server = new Mongoose(".", "9001", - new MongooseEventHandler(EventHandler)); - - Console.WriteLine("Mongoose started, press Ctrl-C to exit."); - for (;;) { - web_server.poll(1000); - } - } -} |