I have a client server MFC Socket based application. I am hooking the mouse
and sending the event messages to the client. On client im simply displaying
the events (real intension is to inject the events using sendInput()).
The problem is that on client if i write the messages on file I can see all
the messages in order there. but if I try to print (or inject using
sendInput()) them I dont get all the messages. also if I write them in file
and print them, then again I dont get all the messages in file. One more
intrusting thing is that when I use telnet instead it displays all the
messages. I have tried using win32 APIs using SOCKET as well instead of
using CSocket. but the result is the same.
I need to recieve messages without missing any of them.
Kindly suggest me what to do.
Thanks in anticipation
Regards,
Ahmad Jalil Qarshi
Are you using UDP or TCP? UDP datagrams don't require establishing a
connection but are not guaranteed to arrive in order or even at all. TCP
requires establishing a connection which is slower but then the protocol
guaranteeds proper delivery. Sounds like you're using UDP....
-- David
Welcome to networking. If you want speed, you've got to use UDP,
which can (and will!) lose packets. If you want all your packets,
you've got to use TCP, which can be slower, as all items must arrive
in order. Pick your poison...
Nathan Mates
--
<*> Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein
And remember, TCP is not a message-based protocol (UDP's datagrams, OTOH,
are message-based). TCP is stream-based, which means that it streams all
your data out as a stream of bytes, without any concern for where one
message ends and another begins. If you want to use TCP for messages (and
most people do), then it's up to you to define and implement some sort of
application-level protocol that defines where in the stream each message
starts and ends.
"Ahmad Jalil Qarshi" <ahmad...@SPAMhotmail.com> wrote in message
news:u8%23HRTyB...@TK2MSFTNGP04.phx.gbl...
--
David Wilkinson
Visual C++ MVP
"David Wilkinson" <no-r...@effisols.com> wrote in message
news:eLiT0d1C...@TK2MSFTNGP05.phx.gbl...