Skip to content
Snippets Groups Projects
Commit f912f156 authored by rswindell's avatar rswindell
Browse files

New BinkP properties:

.connect_host
.connect_port
.connect_error
Allows the application (binkit.js) to log detailed BinkP.connect() failures.
parent bf949f3d
No related branches found
No related tags found
No related merge requests found
......@@ -99,6 +99,9 @@ function BinkP(name_ver, inbound, rx_callback, tx_callback)
this.remote_operator = undefined;
this.remote_capabilities = undefined;
this.remote_info = {};
this.connect_host = undefined;
this.connect_port = undefined;
this.connect_error = undefined;
this.sent_files = [];
this.failed_sent_files = [];
......@@ -423,7 +426,10 @@ BinkP.prototype.connect = function(addr, password, auth_cb, port, inet_host)
this.sock = new Socket(SOCK_STREAM, "binkp");
log(LOG_INFO, "Connecting to "+inet_host+":"+port);
this.connect_host = inet_host;
this.connect_port = port;
if(!this.sock.connect(inet_host, port)) {
this.connect_error = this.sock.error;
this.sock = undefined;
log(LOG_WARNING, "Connection to "+inet_host+":"+port+" failed.");
return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment