So I dusted off my old 'server test' code which some of you might remember - it was as simple server running on my DOS box that you could telnet to and run a few commands. I have used it a few times to test the TCP/IP code under more realistic conditions - it supports 9 simultaneous connections, so if there is a bug it will break the code quickly while juggling all of that work.
Even though one would telnet to the code, it never really supported the telnet protocol. It was just sending raw bytes back and forth. To truly do telnet you have to negotiate line handling options and interpret characters in a specific way.
So I was spending some time today adding telnet support to it. I didn't even get to the telnet specific part yet ... I just wanted to see if I could handle echoing of characters and backspacing. After a few bugs it seemed to work, but wow, the echo was slooooww ... Like hit a key, wait a second, and then get the response. My typing was far far faster then what the poor machine could keep up with.
So now I'm scratching my head wondering what I did wrong. The 386-40 can push 450KB/sec through the wire with my TCP/IP code when doing a file transfer, but it was having a delay of a second on each character it was echoing? I was thinking 'something smells really bad here.'
After about 40 minutes I figured it out. I wasn't using the 'Push' bit on the TCP/IP packets I was using to echo the characters. Without that bit being set the TCP/IP stack on Windows was trying to batch up a few characters before giving the telnet app something to read. After about a second or so it was timing out and giving back my echoed characters as a batch, not one at a time as one would like.
Simple fix, but it caused a little worry. I guess you had to be there.
Even though one would telnet to the code, it never really supported the telnet protocol. It was just sending raw bytes back and forth. To truly do telnet you have to negotiate line handling options and interpret characters in a specific way.
So I was spending some time today adding telnet support to it. I didn't even get to the telnet specific part yet ... I just wanted to see if I could handle echoing of characters and backspacing. After a few bugs it seemed to work, but wow, the echo was slooooww ... Like hit a key, wait a second, and then get the response. My typing was far far faster then what the poor machine could keep up with.
So now I'm scratching my head wondering what I did wrong. The 386-40 can push 450KB/sec through the wire with my TCP/IP code when doing a file transfer, but it was having a delay of a second on each character it was echoing? I was thinking 'something smells really bad here.'
After about 40 minutes I figured it out. I wasn't using the 'Push' bit on the TCP/IP packets I was using to echo the characters. Without that bit being set the TCP/IP stack on Windows was trying to batch up a few characters before giving the telnet app something to read. After about a second or so it was timing out and giving back my echoed characters as a batch, not one at a time as one would like.
Simple fix, but it caused a little worry. I guess you had to be there.