http://mbed.org/users/okini3939/notebook/comet_websocket/

Dependencies:   EthernetNetIf mbed RingBuffer MbedJSONValue

Revision:
0:632cb8c03ca3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CometClient.h	Sat Nov 19 16:19:50 2011 +0000
@@ -0,0 +1,43 @@
+/*
+ * mbed pseudo Comet HTTP Client
+ * Copyright (c) 2011 Hiroshi Suga
+ * Released under the MIT License: http://mbed.org/license/mit
+ */
+
+/** @file
+ * @brief pseud Comet HTTP Client
+ */
+
+#ifndef CometClient_h
+#define CometClient_h
+
+#define DEBUG
+
+#define HTTP_PORT 80
+#define HTTP_TIMEOUT 15000 // ms
+
+#define METHOD_GET 0
+#define METHOD_POST 1
+
+void pollComet ();
+
+int recvComet (char *buf, int size);
+
+int sendComet (char *buf);
+
+/** send http request
+ * @param host http server
+ * @param uri URI
+ * @param head http header (CR+LF) (or NULL)
+ * @param body POST body (or NULL)
+ * @return 0:ok, -1:failue
+ */
+int openComet (Host *host, char *uri, char *head, char *body);
+
+void createauth (char *user, char *pwd, char *buf, int len);
+
+int base64enc(const char *input, unsigned int length, char *output, int len);
+
+int urlencode(char *str, char *buf, int len);
+
+#endif