Subj : Is there a bug in Socket.data_waiting ?
To : nelgin
From : Digital Man
Date : Wed Feb 21 2024 11:25 am
Re: Is there a bug in Socket.data_waiting ?
By: nelgin to Digital man on 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?
I would expect data_waiting to be true.
> 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?
It might be best to figure out what that initial handshake is and deal with that first.
--
digital man (rob)
Synchronet "Real Fact" #58:
The last version of Synchronet to run on MS-DOS and OS/2 was v2.30c (1999)
Norco, CA WX: 61.7�F, 78.0% humidity, 0 mph SSW wind, 0.75 inches rain/24hrs
---
� Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net