Skip to content

Commit

Permalink
feat(Network): add WrappedTransport transport class
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurxavierx committed Dec 27, 2016
1 parent 8bc1433 commit a9f260c
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/Lime/Protocol/Network/WrappedTransport.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import Envelope, { EnvelopeListener } from "../Envelope";
import { SessionCompression, SessionEncryption } from "../Session";
import Transport from './Transport';
import * as Promise from "bluebird";

export default class WrappedTransport implements Transport {

_transport: Transport;

constructor(transport) {
this._transport = transport;
}

open(uri: string): Promise<void> {
return this._transport.open(uri);
}

close(): Promise<void> {
return this._transport.close();
}

send(envelope: Envelope): void {
this._transport.send(envelope);
}

onEnvelope(envelope: Envelope): void {
this._transport.onEnvelope(envelope);
}

getSupportedCompression(): SessionCompression[] {
return this._transport.getSupportedCompression();
}
setCompression(compression: SessionCompression): void {
this._transport.setCompression(compression);
}
get compression(): SessionCompression {
return this._transport.compression;
}

getSupportedEncryption(): SessionEncryption[] {
return this._transport.getSupportedEncryption();
}
setEncryption(encryption: SessionEncryption): void {
this._transport.setEncryption(encryption);
}
get encryption(): SessionEncryption {
return this._transport.encryption;
}
}

0 comments on commit a9f260c

Please sign in to comment.