Client does not need to be an EventEmitter
This commit is contained in:
parent
1d32299fd4
commit
5fda0ab204
2 changed files with 7 additions and 8 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ts-osc",
|
"name": "ts-osc",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"description": "Fully TypeScript-native OSC Client based on osc-min",
|
"description": "Fully TypeScript-native OSC Client based on osc-min",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,11 @@ import { EventEmitter } from 'events';
|
||||||
const osc = new OSCClient("192.168.0.44", 8000)
|
const osc = new OSCClient("192.168.0.44", 8000)
|
||||||
```
|
```
|
||||||
*/
|
*/
|
||||||
export class OSCClient extends EventEmitter {
|
export class OSCClient {
|
||||||
private socket: dgram.Socket;
|
private socket: dgram.Socket;
|
||||||
private host: string;
|
private host: string;
|
||||||
private port: number;
|
private port: number;
|
||||||
constructor(host: string, port: number) {
|
constructor(host: string, port: number) {
|
||||||
super();
|
|
||||||
this.host = host;
|
this.host = host;
|
||||||
this.port = port;
|
this.port = port;
|
||||||
this.socket = dgram.createSocket({ type: 'udp4', reuseAddr: true });
|
this.socket = dgram.createSocket({ type: 'udp4', reuseAddr: true });
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue