Obsolete
/
ipcd
Archived
3
0
Fork 0

TestWS: up to the newest libipc bindings version.

master
Karchnu 2020-07-18 12:14:19 +02:00
parent e86c09d6cb
commit 6355596d6d
1 changed files with 4 additions and 4 deletions

View File

@ -10,12 +10,12 @@ require "../src/lib_modifications.cr"
require "json" require "json"
class TestIPC class TestIPC
property ipcc : IPC::Connection property ipcc : IPC::Client
property is_json : Bool property is_json : Bool
def initialize(service_name : String) def initialize(service_name : String)
@is_json = uri.ends_with? ".JSON" @is_json = uri.ends_with? ".JSON"
@ipcc = IPC::Connection.new service_name @ipcc = IPC::Client.new service_name
end end
# TODO # TODO
@ -60,9 +60,9 @@ class TestWS
m : String | Bytes m : String | Bytes
if @is_json if @is_json
m = IPC::Message.new(1.to_u8, type.to_u8, data).to_json m = IPC::Message.new(0, 1.to_u8, type.to_u8, data).to_json
else else
m = IPC::Message.new(1.to_u8, type.to_u8, data).to_packet m = IPC::Message.new(0, 1.to_u8, type.to_u8, data).to_packet
end end
@ws.send m @ws.send m