Browse Source

添加 'media-send/peer-send/udp.js'

Caner 3 years ago
parent
commit
364ffc9e3f
1 changed files with 11 additions and 0 deletions
  1. 11 0
      media-send/peer-send/udp.js

+ 11 - 0
media-send/peer-send/udp.js

@@ -0,0 +1,11 @@
+const { createSocket } = require('dgram')
+class videoService {
+    constructor(port,callback) {
+        this.udp = createSocket('udp4')
+        this.udp.bind(port)
+        this.udp.on('message', callback)
+        return this.udp
+    }
+}
+
+module.exports = videoService