We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4184d0d commit 4e556c4Copy full SHA for 4e556c4
lib/stomp.js
@@ -110,6 +110,9 @@ function _connect(stomp) {
110
} else {
111
log.debug('Connecting to ' + stomp.host + ':' + stomp.port);
112
stomp.socket = new net.Socket();
113
+ if(stomp.timeout) {
114
+ stomp.socket.setTimeout(stomp.timeout);
115
+ }
116
stomp.socket.connect(stomp.port, stomp.host);
117
_setupListeners(stomp);
118
}
@@ -161,6 +164,11 @@ function _setupListeners(stomp) {
161
164
log.debug("end");
162
165
});
163
166
167
+ socket.on('timeout', function() {
168
+ log.debug('socket timed out');
169
+ stomp.emit("timeout");
170
171
+
172
socket.on('error', function(error) {
173
log.error(error.stack + 'error name: ' + error.name);
174
stomp.emit("error", error);
0 commit comments