Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Recieveing Bulk of Messages of small size using Sockets

2 views
Skip to first unread message

Ahmad Jalil Qarshi

unread,
Oct 5, 2007, 3:42:36 AM10/5/07
to
Hi,

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

David Ching

unread,
Oct 5, 2007, 10:02:10 AM10/5/07
to
"Ahmad Jalil Qarshi" <ahmad...@SPAMhotmail.com> wrote in message
news:u8%23HRTyB...@TK2MSFTNGP04.phx.gbl...

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


Nathan Mates

unread,
Oct 5, 2007, 12:30:57 PM10/5/07
to
In article <u8#HRTyBI...@TK2MSFTNGP04.phx.gbl>,

Ahmad Jalil Qarshi <ahmad...@SPAMhotmail.com> wrote:
>I need to recieve messages without missing any of them.

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

Michael K. O'Neill

unread,
Oct 5, 2007, 3:22:47 PM10/5/07
to

"Nathan Mates" <nat...@visi.com> wrote in message
news:13gcpm1...@corp.supernews.com...

> In article <u8#HRTyBI...@TK2MSFTNGP04.phx.gbl>,
> Ahmad Jalil Qarshi <ahmad...@SPAMhotmail.com> wrote:
> >I need to recieve messages without missing any of them.
>
> 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
>
> --

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.


Sam Hobbs

unread,
Oct 6, 2007, 1:02:55 PM10/6/07
to
The mouse move message is a high-volume message; probably the highest
volume.


"Ahmad Jalil Qarshi" <ahmad...@SPAMhotmail.com> wrote in message
news:u8%23HRTyB...@TK2MSFTNGP04.phx.gbl...

David Wilkinson

unread,
Oct 10, 2007, 12:06:01 PM10/10/07
to
Please excuse this test of my newsreader (SeaMonkey) to send to multiple
newsgroups. It was not working before, but I think it was because I had
subscribed to some of the microsoft.public groups both on
news.microsoft.com and via my ISP's news feed. This confused SeaMonkey
into thinking that I was posting to multiple servers.

--
David Wilkinson
Visual C++ MVP

Sam Hobbs

unread,
Oct 10, 2007, 2:16:13 PM10/10/07
to
I was not describing newsgroup messages, I was describing Windows messages.
I thought Ahmad Jalil Qarshi is asking about Windows messages; am I wrong?


"David Wilkinson" <no-r...@effisols.com> wrote in message
news:eLiT0d1C...@TK2MSFTNGP05.phx.gbl...

0 new messages