Added support for setting custom ping messages with support for any 'ping' message type (binary ping message, text ping message) (#438)
* Added support for setting custom ping messages with support for any 'ping' message type (binary ping message, text ping message) * Add default value --------- Co-authored-by: YuHuanTin <2@>
This commit is contained in:
@ -53,6 +53,8 @@ namespace ix
|
||||
void setPerMessageDeflateOptions(
|
||||
const WebSocketPerMessageDeflateOptions& perMessageDeflateOptions);
|
||||
void setTLSOptions(const SocketTLSOptions& socketTLSOptions);
|
||||
void setPingMessage(const std::string& sendMessage,
|
||||
SendMessageKind pingType = SendMessageKind::Ping);
|
||||
void setPingInterval(int pingIntervalSecs);
|
||||
void enablePong();
|
||||
void disablePong();
|
||||
@ -88,7 +90,7 @@ namespace ix
|
||||
const OnProgressCallback& onProgressCallback = nullptr);
|
||||
WebSocketSendInfo sendText(const std::string& text,
|
||||
const OnProgressCallback& onProgressCallback = nullptr);
|
||||
WebSocketSendInfo ping(const std::string& text);
|
||||
WebSocketSendInfo ping(const std::string& text,SendMessageKind pingType = SendMessageKind::Ping);
|
||||
|
||||
void close(uint16_t code = WebSocketCloseConstants::kNormalClosureCode,
|
||||
const std::string& reason = WebSocketCloseConstants::kNormalClosureMessage);
|
||||
@ -103,6 +105,7 @@ namespace ix
|
||||
|
||||
const std::string getUrl() const;
|
||||
const WebSocketPerMessageDeflateOptions getPerMessageDeflateOptions() const;
|
||||
const std::string getPingMessage() const;
|
||||
int getPingInterval() const;
|
||||
size_t bufferedAmount() const;
|
||||
|
||||
@ -170,6 +173,8 @@ namespace ix
|
||||
// Optional ping and pong timeout
|
||||
int _pingIntervalSecs;
|
||||
int _pingTimeoutSecs;
|
||||
std::string _pingMessage;
|
||||
SendMessageKind _pingType;
|
||||
static const int kDefaultPingIntervalSecs;
|
||||
static const int kDefaultPingTimeoutSecs;
|
||||
|
||||
|
Reference in New Issue
Block a user