digitalmars.D - reading and writing from a socket simo at once
- Ameer Armaly (8/8) Jul 06 2005 Hi.
- Regan Heath (9/11) Jul 06 2005 Start a thread, in that thread read data from the socket into a buffer. ...
- Regan Heath (6/8) Jul 07 2005 Here is an example telnet program I just wrote in D. I don't guarantee i...
Hi. How would I be able to read from a socket, but still take in info from the keyboard and send it out;kind of like telnet? -- --- Life is either tragedy or comedy. Usually it's your choice. You can whine or you can laugh. --Animorphs
Jul 06 2005
On Wed, 6 Jul 2005 17:31:56 -0400, Ameer Armaly <ameer_armaly hotmail.com> wrote:How would I be able to read from a socket, but still take in info from the keyboard and send it out;kind of like telnet?Start a thread, in that thread read data from the socket into a buffer. The main thread then loops checking for data in the buffer and checking for keystrokes. You need a non blocking keystroke checking function, some functions block until a complete line has been entered. You'll need to synchronise access to the socket and the buffer, probably best to place both of these in a class dedicated to this purpose. Regan
Jul 06 2005
On Wed, 6 Jul 2005 17:31:56 -0400, Ameer Armaly <ameer_armaly hotmail.com> wrote:How would I be able to read from a socket, but still take in info from the keyboard and send it out;kind of like telnet?Here is an example telnet program I just wrote in D. I don't guarantee it works at all, especially on anything other than windows, or for the most basic things. Regan
Jul 07 2005