Obsolete
/
libipc-old
Archived
3
0
Fork 0

.size != .bytesize!!

Again!
more_to_read
Luka Vandervelden 2018-11-11 03:01:10 +09:00
parent 7699aa8d27
commit ab3d9dd344
1 changed files with 2 additions and 2 deletions

View File

@ -178,7 +178,7 @@ class IPC::RemoteClient
end end
def send(type : UInt8, payload : String) def send(type : UInt8, payload : String)
message = LibIPC::Message.new type: type, length: payload.size, payload: payload.to_unsafe message = LibIPC::Message.new type: type, length: payload.bytesize, payload: payload.to_unsafe
if LibIPC.ipc_server_write(pointerof(@client), pointerof(message)) < 0 if LibIPC.ipc_server_write(pointerof(@client), pointerof(message)) < 0
raise Exception.new "ipc_server_write < 0" raise Exception.new "ipc_server_write < 0"
@ -224,7 +224,7 @@ class IPC::Client
end end
def send(type, payload : String) def send(type, payload : String)
message = LibIPC::Message.new type: type, length: payload.size, payload: payload.to_unsafe message = LibIPC::Message.new type: type, length: payload.bytesize, payload: payload.to_unsafe
if LibIPC.ipc_application_write(pointerof(@service), pointerof(message)) < 0 if LibIPC.ipc_application_write(pointerof(@service), pointerof(message)) < 0
raise Exception.new "ipc_application_write < 0" raise Exception.new "ipc_application_write < 0"