TestWS: up to the newest libipc bindings version.
parent
e86c09d6cb
commit
6355596d6d
|
@ -10,12 +10,12 @@ require "../src/lib_modifications.cr"
|
|||
require "json"
|
||||
|
||||
class TestIPC
|
||||
property ipcc : IPC::Connection
|
||||
property ipcc : IPC::Client
|
||||
property is_json : Bool
|
||||
|
||||
def initialize(service_name : String)
|
||||
@is_json = uri.ends_with? ".JSON"
|
||||
@ipcc = IPC::Connection.new service_name
|
||||
@ipcc = IPC::Client.new service_name
|
||||
end
|
||||
|
||||
# TODO
|
||||
|
@ -60,9 +60,9 @@ class TestWS
|
|||
m : String | Bytes
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
@ws.send m
|
||||
|
|
Reference in New Issue