Skip to content

Commit 5ed72c8

Browse files
committed
Set minimum node.js requirement as 0.12.18.
1 parent 855ab98 commit 5ed72c8

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ node_js:
66
- "6"
77
- "4"
88
- "0.12"
9-
- "0.10"
109
branches:
1110
only:
1211
- master

CloudI.js

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -233,18 +233,9 @@ CloudI.API = function API (thread_index, callback) {
233233
else {
234234
throw new InvalidInputException();
235235
}
236-
if (Erlang.nodejs_version_after('0.12.1',false)) {
237-
API._s_in = new net.Socket({fd: (thread_index + 3),
238-
readable: true,
239-
writable: true});
240-
API._s_out = API._s_in;
241-
}
242-
else {
243-
API._s_in = new net.Socket({fd: (thread_index + 3),
244-
readable: true,
245-
writable: false});
246-
API._s_out = fs.createWriteStream(null, {fd: (thread_index + 3)});
247-
}
236+
API._socket = new net.Socket({fd: (thread_index + 3),
237+
readable: true,
238+
writable: true});
248239
API._initialization_complete = false;
249240
API._terminate = false;
250241
API._terminate_callback = undefined;
@@ -255,7 +246,7 @@ CloudI.API = function API (thread_index, callback) {
255246
API._poll_callbacks_pending = [];
256247
API._poll_data = undefined;
257248
API._poll_data_size = undefined;
258-
API._s_in.on('data', function(data) {
249+
API._socket.on('data', function(data) {
259250
try {
260251
if (! API._use_header) {
261252
API._poll_request(data);
@@ -299,7 +290,7 @@ CloudI.API = function API (thread_index, callback) {
299290
}
300291
}
301292
});
302-
API._s_in.on('error', function(err) {
293+
API._socket.on('error', function(err) {
303294
API._exception(err);
304295
API._poll_terminate();
305296
});
@@ -1012,7 +1003,7 @@ CloudI.API.prototype._poll_wait = function (f) {
10121003
CloudI.API.prototype._poll_terminate = function () {
10131004
var API = this;
10141005
API._terminate = true;
1015-
API._s_in.destroy();
1006+
API._socket.destroy();
10161007
if (API._terminate_callback !== undefined) {
10171008
API._terminate_callback(false);
10181009
}
@@ -1157,7 +1148,7 @@ CloudI.API.prototype._send = function (terms) {
11571148
if (API._use_header) {
11581149
data = Buffer.concat([packUint32big(data.length), data]);
11591150
}
1160-
API._s_out.write(data, 'binary');
1151+
API._socket.write(data, 'binary');
11611152
});
11621153
};
11631154

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2014-2019 Michael Truog <mjtruog at protonmail dot com>
3+
Copyright (c) 2014-2020 Michael Truog <mjtruog at protonmail dot com>
44

55
Permission is hereby granted, free of charge, to any person obtaining a
66
copy of this software and associated documentation files (the "Software"),

0 commit comments

Comments
 (0)