Skip to content

Commit

Permalink
fix: multi osc device udp stateless
Browse files Browse the repository at this point in the history
  • Loading branch information
mint-dewit committed Dec 15, 2022
1 parent b987680 commit af34aa0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class OSCConnection extends EventEmitter {
connectionId: string
host: string
port: number
private _type: OSCDeviceType

private _oscClient: osc.UDPPort | osc.TCPSocketPort
private _oscSender: OSCSender
Expand All @@ -27,6 +28,7 @@ export class OSCConnection extends EventEmitter {
this.connectionId = options.connectionId
this.host = options.host
this.port = options.port
this._type = options.type
this._oscSender = options.oscSender || this._defaultOscSender.bind(this)

if (options.type === OSCDeviceType.UDP) {
Expand Down Expand Up @@ -75,7 +77,7 @@ export class OSCConnection extends EventEmitter {
}

get connected(): boolean {
return this._connected
return this._type === OSCDeviceType.TCP ? this._connected : true
}

private updateIsConnected(connected: boolean) {
Expand Down

0 comments on commit af34aa0

Please sign in to comment.