Commit 7b4fd42c authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Send a PING line after message line(s), wait for response.

Is this what you had in mind, Cyan?
parent c3b48b24
...@@ -65,7 +65,7 @@ if(!my_server) { ...@@ -65,7 +65,7 @@ if(!my_server) {
} }
var done=0; var done=0;
while(!done) { while(!done && !js.terminated) {
while(!done && (response=my_server.recvline())) { while(!done && (response=my_server.recvline())) {
var resp=response.split(/\s+/); var resp=response.split(/\s+/);
if(resp[1]=='433') { if(resp[1]=='433') {
...@@ -107,6 +107,10 @@ else while((msg=readln())!=undefined) { /* read from stdin */ ...@@ -107,6 +107,10 @@ else while((msg=readln())!=undefined) { /* read from stdin */
while(my_server.poll(0) && (response=my_server.recvline())) while(my_server.poll(0) && (response=my_server.recvline()))
mylog(response); mylog(response);
if(my_server.sendline("PING :"+ nick)) {
mylog(my_server.recvline());
}
IRC_quit(my_server); IRC_quit(my_server);
mylog("Exiting"); mylog("Exiting");
exit(); exit();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment