Simple websocket client

Dependents:   Websocket_Ethernet_HelloWorld Websocket_Wifly_HelloWorld RPC_Wifly_HelloWorld RPC_Ethernet_HelloWorld ... more

Revision:
6:86e89a0369b9
Parent:
4:466f90b7849a
diff -r bb09d7a6c92f -r 86e89a0369b9 Websocket.h
--- a/Websocket.h	Wed Aug 29 13:49:48 2012 +0000
+++ b/Websocket.h	Wed Aug 29 15:27:51 2012 +0000
@@ -32,7 +32,6 @@
 #define WEBSOCKET_H
 
 #include "mbed.h"
-#include <string>
 
 #include "TCPSocketConnection.h"
 
@@ -120,19 +119,21 @@
         *
         * @return path
         */
-        std::string getPath();
+        char* getPath();
 
     private:
 
         void fillFields(char * url);
+        int parseURL(const char* url, char* scheme, size_t maxSchemeLen, char* host, size_t maxHostLen, uint16_t* port, char* path, size_t maxPathLen); //Parse URL
         int sendOpcode(uint8_t opcode, char * msg);
         int sendLength(uint32_t len, char * msg);
         int sendMask(char * msg);
         int readChar(char * pC, bool block = true);
-
-        std::string ip_domain;
-        std::string path;
-        std::string port;
+        
+        char scheme[8];
+        uint16_t port;
+        char host[32];
+        char path[64];
         
         TCPSocketConnection socket;