-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
sandbox.js
49 lines (37 loc) · 1.19 KB
/
sandbox.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
var fs = require('fs');
var simpleSocket = require('./index');
var port = 30904;
var server;
server = simpleSocket.listen(port, (err, serverToClient) => {
serverToClient.readFile('E:/VMs/_iso/linuxmint-16-cinnamon-dvd-32bit.out.iso').then(() => {
if (1 == 2) {
}
}, (err) => {
if (err) {
}
});
}).then((srv) => {
console.log('Listening on port ' + port);
var client = simpleSocket.connect(port).then((clientToServer) => {
clientToServer.on('write.before', function() {
if (arguments) {
}
});
clientToServer.on('write.after', function() {
if (arguments) {
}
});
clientToServer.writeFile('E:/VMs/_iso/linuxmint-16-cinnamon-dvd-32bit.iso').then(() => {
if (1 == 2) {
}
}, (err) => {
if (err) {
}
});
}, (err) => {
console.log('[ERROR] Could not connect to port ' + port + ': ' + err);
});
}, (err) => {
console.log('[ERROR] Could not listen on port ' + port + ': ' + err);
});
console.log('OK');