resolved some issue and added method to read readystate of the websocket

This commit is contained in:
Pasquale Boemio
2013-05-11 09:55:41 +02:00
parent 7ac70dbdcf
commit bc1368b849
3 changed files with 20 additions and 16 deletions
+2
View File
@@ -14,6 +14,7 @@ namespace easywsclient {
struct WebSocket {
typedef WebSocket * pointer;
typedef enum readyStateValues { CLOSING, CLOSED, CONNECTING, OPEN } readyStateValues;
// Factories:
static pointer create_dummy();
@@ -24,6 +25,7 @@ struct WebSocket {
virtual void poll() = 0;
virtual void send(std::string message) = 0;
virtual void close() = 0;
virtual const readyStateValues getReadyState() = 0;
template<class Callable>
void dispatch(Callable callable) { // N.B. this is compatible with both C++11 lambdas, functors and C function pointers
struct _Callback : public Callback {