cinatra icon indicating copy to clipboard operation
cinatra copied to clipboard

考虑在后续版本中增强cinatra作为websocket 服务端的功能?

Open sese53 opened this issue 2 years ago • 0 comments

req.on(ws_ping, [](request& req) -> bool {
			std::string payload = req.get_part_data();//最多125字节的ping包payload数据
			// check payload some attribute
			return true; //true if a pong response should be sent, false will not;
		});
req.on(ws_pong, [](request& req) -> void {
			std::string payload = req.get_part_data();////最多125字节的pong包payload数据
		});
req.on(ws_pong_timeout, [](request& req) -> void {
			uint32_t timeout = req->get_timeout();
			auto conn = req.get_conn<cinatra::NonSSL>();
			conn->on_close();
		});

除开ws_open, ws_close, ws_error, ws_message四个data_proc_state的状态处理外 1.ws_ping接收到ping包,ws_pong接收到pong包,ws_pong_timeout一定时间未接收到pong包或任意消息。 希望增加有关这几种状态的处理 handler。 2.ping包和pong包中按照协议,应该允许用户同时发送不大于126字节的payload,我这里太需要这点cinatra在接口上能支持。 image

sese53 avatar Aug 22 '22 05:08 sese53