-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Network): add WrappedTransport transport class
- Loading branch information
1 parent
8bc1433
commit a9f260c
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |