Created
June 17, 2009 04:28
-
-
Save snuxoll/131080 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GLib; | |
namespace SoupServer { | |
class ServerApplication : Object { | |
private Soup.Server server; | |
public ServerApplication() { | |
server = new Soup.Server(Soup.SERVER_PORT, 8000, null); | |
} | |
public void respond(Soup.Server server, Soup.Message msg, | |
string path, HashTable? query, Soup.ClientContext client) { | |
msg.set_status(Soup.KnownStatusCode.OK); | |
msg.set_response("text/plain", Soup.MemoryUse.COPY, | |
"TEST!", 4); | |
return; | |
} | |
public void run() { | |
server.add_handler("/", respond); | |
server.run(); | |
} | |
static int main(string[] args) { | |
var app = new ServerApplication(); | |
app.run(); | |
return 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment