can create a socket from a fd

This commit is contained in:
Benjamin Sergeant
2018-12-29 21:53:33 -08:00
parent 43cd6d34ca
commit ea07afcc0b
8 changed files with 82 additions and 48 deletions

View File

@ -74,10 +74,14 @@ namespace ix
WebSocketTransport();
~WebSocketTransport();
// Client
void configure(const std::string& url,
const WebSocketPerMessageDeflateOptions& perMessageDeflateOptions);
WebSocketInitResult init();
// Server
WebSocketInitResult initFromSocket(int fd);
void poll();
WebSocketSendInfo sendBinary(const std::string& message);
WebSocketSendInfo sendPing(const std::string& message);
@ -164,5 +168,8 @@ namespace ix
// Non blocking versions of read/write, used during http upgrade
bool readByte(void* buffer);
bool writeBytes(const std::string& str);
// Parse HTTP headers
std::pair<bool, WebSocketHttpHeaders> parseHttpHeaders();
};
}