增加disconn
This commit is contained in:
@@ -37,6 +37,9 @@ namespace ylib
|
||||
/// 发送
|
||||
/// </summary>
|
||||
bool send(int64 conn, std::string_view value);
|
||||
/// @brief 断开连接
|
||||
/// @param conn
|
||||
void disconn(int64 conn);
|
||||
|
||||
void on_accept(std::function<bool(int64)> callback) { m_callback_accept = callback; }
|
||||
void on_recv(std::function<bool(int64,const char* data, int len)> callback) { m_callback_recv = callback; }
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "net/http_wsserver.h"
|
||||
//#include "HPSocket/HPSocket.h"
|
||||
#include "HPSocket/HPSocket-SSL.h"
|
||||
#include "util/codec.h"
|
||||
|
||||
@@ -231,6 +230,7 @@ void ylib::network::http::wsserver::stop()
|
||||
|
||||
bool ylib::network::http::wsserver::send(int64 conn, std::string_view value)
|
||||
{
|
||||
|
||||
BOOL bFinal;
|
||||
BYTE iReserved;
|
||||
BYTE iOperationCode;
|
||||
@@ -238,3 +238,8 @@ bool ylib::network::http::wsserver::send(int64 conn, std::string_view value)
|
||||
return false;
|
||||
return HPSERVER->SendWSMessage(conn,bFinal,iReserved,iOperationCode,(const BYTE*)value.data(),value.length());
|
||||
}
|
||||
|
||||
void ylib::network::http::wsserver::disconn(int64 conn)
|
||||
{
|
||||
HPSERVER->Disconnect(conn);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user