Przeglądaj źródła

msgpack to binarypack migration

Michelle Bu 12 lat temu
rodzic
commit
98c18fffd4
3 zmienionych plików z 5 dodań i 5 usunięć
  1. 1 1
      public/js/binarypack
  2. 2 2
      public/js/sink.js
  3. 2 2
      public/js/source.js

+ 1 - 1
public/js/binarypack

@@ -1 +1 @@
-Subproject commit d88e0869541b0295ec0b42fdd2b2b7caa6fe4867
+Subproject commit 69e5a2a2c07f00e3b259171c0b02c3b6a33074c4

+ 2 - 2
public/js/sink.js

@@ -184,7 +184,7 @@ SinkPeer.prototype.setupDataChannel = function(originator, target, cb) {
 };
 
 SinkPeer.prototype.send = function(data) {
-  var ab = MsgPack.encode(data);
+  var ab = BinaryPack.pack(data);
   this._dc.send(ab);
 }
 
@@ -192,7 +192,7 @@ SinkPeer.prototype.send = function(data) {
 // Handles a DataChannel message.
 // TODO: have these extend Peer, which will impl these generic handlers.
 SinkPeer.prototype.handleDataMessage = function(e) {
-  data = MsgPack.decode(e.data);
+  data = BinaryPack.unpack(e.data);
 
   if (!!this._dataHandler) {
     this._dataHandler(data);

+ 2 - 2
public/js/source.js

@@ -131,7 +131,7 @@ SourcePeer.prototype.setupDataChannel = function(pc, target, cb) {
 
 SourcePeer.prototype.send = function(data, sink) {
   // TODO: try/catch
-  var ab = MsgPack.encode(data);
+  var ab = BinaryPack.pack(data);
 
   if (!!sink) {
     this._dcs[sink].send(ab);
@@ -148,7 +148,7 @@ SourcePeer.prototype.send = function(data, sink) {
 
 // Handles a DataChannel message.
 SourcePeer.prototype.handleDataMessage = function(e) {
-  var data = MsgPack.decode(e.data);
+  var data = BinaryPack.unpack(e.data);
 
   if (!!this._dataHandler) {
     this._dataHandler(data);