Rename struct to class (to help new C++ users who are unfamiliar that structs are classes).
This commit is contained in:
+7
-7
@@ -47,14 +47,10 @@ int hostname_connect(std::string hostname, int port) {
|
|||||||
return sockfd;
|
return sockfd;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
class _DummyWebSocket : public easywsclient::WebSocket
|
||||||
|
|
||||||
namespace easywsclient {
|
|
||||||
|
|
||||||
struct _DummyWebSocket : public WebSocket
|
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
void poll() { }
|
void poll() { }
|
||||||
void send(std::string message) { }
|
void send(std::string message) { }
|
||||||
void close() { }
|
void close() { }
|
||||||
@@ -64,8 +60,9 @@ struct _DummyWebSocket : public WebSocket
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct _RealWebSocket : public WebSocket
|
class _RealWebSocket : public easywsclient::WebSocket
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
// http://tools.ietf.org/html/rfc6455#section-5.2 Base Framing Protocol
|
// http://tools.ietf.org/html/rfc6455#section-5.2 Base Framing Protocol
|
||||||
//
|
//
|
||||||
// 0 1 2 3
|
// 0 1 2 3
|
||||||
@@ -264,9 +261,12 @@ struct _RealWebSocket : public WebSocket
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // end of module-only namespace
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace easywsclient {
|
||||||
|
|
||||||
WebSocket::pointer WebSocket::create_dummy() {
|
WebSocket::pointer WebSocket::create_dummy() {
|
||||||
static pointer dummy = pointer(new _DummyWebSocket);
|
static pointer dummy = pointer(new _DummyWebSocket);
|
||||||
return dummy;
|
return dummy;
|
||||||
|
|||||||
+2
-1
@@ -12,7 +12,8 @@
|
|||||||
|
|
||||||
namespace easywsclient {
|
namespace easywsclient {
|
||||||
|
|
||||||
struct WebSocket {
|
class WebSocket {
|
||||||
|
public:
|
||||||
typedef WebSocket * pointer;
|
typedef WebSocket * pointer;
|
||||||
typedef enum readyStateValues { CLOSING, CLOSED, CONNECTING, OPEN } readyStateValues;
|
typedef enum readyStateValues { CLOSING, CLOSED, CONNECTING, OPEN } readyStateValues;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user