mirror of
https://github.com/koush/scrypted.git
synced 2026-02-10 09:12:03 +00:00
16 lines
555 B
TypeScript
16 lines
555 B
TypeScript
import { RpcSerializer } from "../rpc";
|
|
|
|
export class SidebandSocketSerializer implements RpcSerializer {
|
|
serialize(value: any, serializationContext?: any) {
|
|
if (!serializationContext)
|
|
throw new Error('socket serialization context unavailable');
|
|
serializationContext.sendHandle = value;
|
|
}
|
|
|
|
deserialize(serialized: any, serializationContext?: any) {
|
|
if (!serializationContext)
|
|
throw new Error('socket deserialization context unavailable');
|
|
return serializationContext.sendHandle;
|
|
}
|
|
}
|