JavaScript: Add basic model of client-side socket.io API.

This commit is contained in:
Max Schaefer
2019-02-27 16:37:59 +00:00
parent 363c11e89d
commit b47b26ca61
22 changed files with 200 additions and 1 deletions

View File

@@ -0,0 +1,3 @@
| client2.js:4:1:6:2 | sock.on ... y);\\n}) | client2.js:1:12:1:56 | require ... lhost") |
| client2.js:8:1:8:33 | sock.on ... => {}) | client2.js:1:12:1:56 | require ... lhost") |
| client2.js:10:1:12:2 | sock.on ... d");\\n}) | client2.js:1:12:1:56 | require ... lhost") |

View File

@@ -0,0 +1,4 @@
import javascript
from SocketIOClient::ReceiveNode rn
select rn, rn.getSocket()

View File

@@ -0,0 +1,4 @@
| client2.js:4:1:6:2 | sock.on ... y);\\n}) | client2.js:4:21:4:21 | x |
| client2.js:4:1:6:2 | sock.on ... y);\\n}) | client2.js:4:24:4:24 | y |
| client2.js:8:1:8:33 | sock.on ... => {}) | client2.js:8:23:8:25 | msg |
| client2.js:10:1:12:2 | sock.on ... d");\\n}) | client2.js:10:18:10:18 | x |

View File

@@ -0,0 +1,4 @@
import javascript
from SocketIOClient::ReceiveNode rn
select rn, rn.getAReceivedItem()

View File

@@ -0,0 +1 @@
| client2.js:10:1:12:2 | sock.on ... d");\\n}) | client2.js:10:21:10:22 | cb |

View File

@@ -0,0 +1,4 @@
import javascript
from SocketIOClient::ReceiveNode rn
select rn, rn.getAck()

View File

@@ -0,0 +1,2 @@
| client2.js:4:1:6:2 | sock.on ... y);\\n}) | message |
| client2.js:10:1:12:2 | sock.on ... d");\\n}) | data |

View File

@@ -0,0 +1,4 @@
import javascript
from SocketIOClient::ReceiveNode rn
select rn, rn.getEventName()

View File

@@ -0,0 +1,2 @@
| client2.js:14:1:14:32 | sock.em ... there") | client2.js:1:12:1:56 | require ... lhost") | / |
| client2.js:16:1:16:36 | sock.wr ... => {}) | client2.js:1:12:1:56 | require ... lhost") | / |

View File

@@ -0,0 +1,4 @@
import javascript
from SocketIOClient::SendNode sn
select sn, sn.getSocket(), sn.getNamespacePath()

View File

@@ -0,0 +1,3 @@
| client2.js:14:1:14:32 | sock.em ... there") | client2.js:14:19:14:22 | "hi" |
| client2.js:14:1:14:32 | sock.em ... there") | client2.js:14:25:14:31 | "there" |
| client2.js:16:1:16:36 | sock.wr ... => {}) | client2.js:16:12:16:25 | "do you copy?" |

View File

@@ -0,0 +1,4 @@
import javascript
from SocketIOClient::SendNode sn
select sn, sn.getASentItem()

View File

@@ -0,0 +1 @@
| client2.js:16:1:16:36 | sock.wr ... => {}) | client2.js:16:28:16:35 | () => {} |

View File

@@ -0,0 +1,4 @@
import javascript
from SocketIOClient::SendNode sn
select sn, sn.getAck()

View File

@@ -0,0 +1,2 @@
| client2.js:14:1:14:32 | sock.em ... there") | data |
| client2.js:16:1:16:36 | sock.wr ... => {}) | message |

View File

@@ -0,0 +1,4 @@
import javascript
from SocketIOClient::SendNode sn
select sn, sn.getEventName()

View File

@@ -0,0 +1,5 @@
| client1.js:1:1:1:4 | io() | / |
| client1.js:2:1:2:23 | io.conn ... sages") | /messages |
| client2.js:1:12:1:56 | require ... lhost") | / |
| client2.js:2:1:2:73 | require ... v#abc") | /foo/bar |
| client3.js:3:1:3:4 | io() | / |

View File

@@ -0,0 +1,4 @@
import javascript
from SocketIOClient::SocketNode sn
select sn, sn.getNamespacePath()

View File

@@ -0,0 +1,2 @@
io();
io.connect("/messages");

View File

@@ -0,0 +1,16 @@
var sock = require("socket.io-client")("ws://localhost");
require("socket.io-client").connect("http://example.com/foo/bar?q=v#abc");
sock.on('message', (x, y) => {
console.log(x, y);
})
sock.on(eventName(), (msg) => {});
sock.on('data', (x, cb) => {
cb("received");
});
sock.emit('data', "hi", "there");
sock.write("do you copy?", () => {});

View File

@@ -0,0 +1,3 @@
import io from "socket.io-client";
io();