basic winsock client example?

J

Jim Langston

AdamMaynard24 said:
Can someone give me an example of a basic telnet client that can send
and receive data using WSAAsyncSelect().. to get a notification?

I've come up with something, but it doesn't quite function. Using
Send(), i'm not getting any errors and i'm attaching a CRLF on to the
end of each line, but apart from the inital FD_READ notification when I
connect to a telnet server, I don't get a FD_READ after I send
something, which when I connect to the same server with telnet, and
send the same string, the telnet server will send back a load of text.
Actually, it doesn't matter what text you send to the test telnet
server (a MUD), it will send back the same info. So I'm connecting
fine, the FD_READ seems to be working fine, because it fires when I
connect, then when I send(), no errors - the FD_READ does not fire, so
I can't do anything about the incoming data.

Thanks.

Make sure you are sending a carriage return '\n' at the end of your
transmission. It may just be that you aren't terminating the send with the
carriage return and the telnet server is still waiting for it.
 
A

AdamMaynard24

Can someone give me an example of a basic telnet client that can send
and receive data using WSAAsyncSelect().. to get a notification?

I've come up with something, but it doesn't quite function. Using
Send(), i'm not getting any errors and i'm attaching a CRLF on to the
end of each line, but apart from the inital FD_READ notification when I
connect to a telnet server, I don't get a FD_READ after I send
something, which when I connect to the same server with telnet, and
send the same string, the telnet server will send back a load of text.
Actually, it doesn't matter what text you send to the test telnet
server (a MUD), it will send back the same info. So I'm connecting
fine, the FD_READ seems to be working fine, because it fires when I
connect, then when I send(), no errors - the FD_READ does not fire, so
I can't do anything about the incoming data.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top