Subj : Is there a bug in Socket.data_waiting ?
To   : Digital man
From : nelgin
Date : Wed Feb 21 2024 11:30 am

I'm trying to fetch the login screen for a MUD and having some issues.

If I use telnet aardmud.org 4000 then it connects and.
nc aardmud.org 4000 produces some junk characters and then displays the login screen. I guess they're some sort of terminal detection or negotiation. tcpdump output doesn't look like telnet negotiation.

Now with js I'm trying this:

var sock = new Socket(SOCK_STREAM);
try { sock.connect('aardmud.org',4000,5) }
catch(e) {
       writeln(e);
       exit();
}
sock.is_connected show true. So let me check if there's some data waiting for me.

sock.data_waiting shows false
sock.ndata shows 0
sock.poll(0,true) shows the socket is set for reading.

now if I use sock.recvline I get a line of data. So if there's data waiting, why wouldn't data_waiting tell me?

Maybe I am misunderstanding how it all works.

What would be the best way of getting the data upto the point where I am asked to login?

---
� Synchronet � End Of The Line BBS - endofthelinebbs.com