mirror of
https://git.suyu.dev/suyu/discord-rpc.git
synced 2026-01-02 04:35:39 +01:00
clean out simplest version
This commit is contained in:
parent
79e0e336c5
commit
29641da939
10 changed files with 5 additions and 556 deletions
|
|
@ -56,14 +56,16 @@ void RpcConnection::Close()
|
|||
state = State::Disconnected;
|
||||
}
|
||||
|
||||
void RpcConnection::Write(const void* data, size_t length)
|
||||
bool RpcConnection::Write(const void* data, size_t length)
|
||||
{
|
||||
sendFrame.opcode = Opcode::Frame;
|
||||
memcpy(sendFrame.message, data, length);
|
||||
sendFrame.length = length;
|
||||
if (!connection->Write(&sendFrame, sizeof(MessageFrameHeader) + length)) {
|
||||
Close();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RpcConnection::Read(rapidjson::Document& message)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue