Networking Forums

Networking Forums > Computer Networking > Windows Networking > Help Needed: One "recv()" contains data sent by many "send()" ...

Reply
Thread Tools Display Modes

Help Needed: One "recv()" contains data sent by many "send()" ...

 
 
Shashank Welankar
Guest
Posts: n/a

 
      05-18-2004, 01:17 PM
Sub: Help Needed: One "recv()" contains data sent by many "send()" ...
Hi,

I have a Server Application, as usual listening on certain port and
accepting connections. It recvand send data between clients. I have a fixed
format of sending messages from clients. All clients send data enclosed
in*[ and ]* character sequence, eg: suppose the data from client A is this -
*[Hello, How are you? Sending filename in next message]*
then next message will be-
*[C:\VipulPathak\SendableFiles\RunTimeLog.csv]*

Now, this works fine. But when any client start sending data too rapidly,
then it often become possible that 2 messages clubbed into one recv(), for
example, On executing recv() with a buffer of size > 512 bytes, the buffer
possible might contain this:
*[Hello, How are you? Sending filename in next
message]**[C:\VipulPathak\SendableFiles\RunTimeLog.csv]*...

Only one recv now contain both the messages. In this situation, I need to
parse data and separate the messages manually by string processing. But
possible many times more messages behind these messages. And usually the
last messages is Incomplete.

My concern is this Incomplete message, in my application these Incomplete
messages are usless. So I must eleminate them. I can see 2 options to solve,
this problem:
a) Either I receive one message at a time from WinSock Layer, (ie One
recv() call must return one message).
b) OR the Last message must be complete, if there is space but not as
much that can hold next message, then this left space must not be used.

Am I right, any other Solution some one can suggest.
Also, please suggest a way, using which atleast one of the option a -or- b,
can be achieved.

Regards.

-Vipul Pathak ;


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for "No Wires Needed" "Swallow 1100" WinXP drivers GdB Wireless Internet 1 06-18-2008 12:07 AM
[Fwd: SPEWS DOLTS "SneakyP", "Kevin!:?)", "WindsorFox" SPAM braodbandnewsgroup] !:?) Broadband 0 11-30-2005 01:04 AM
Re: SPEWS SLIMES "WindsorFox", "Kevin-!:?)", "Spin Dryer" get the cold shoulder at broadband ng! SneakyP Broadband 0 11-29-2005 10:46 PM
Attention Plus.net Re: SPEWS DOLTS "WindsorFox", "Kevin-!:?)", "SpinDryer" SPAM broadband newsgroup !:?) Broadband 0 11-28-2005 04:28 AM
Attention Plus.Net Re: SPEWS DOLTS "WindsorFox", "Kevin-!:?)", "SpinDryer" SPAM braodband newsgroup !:?) Broadband 0 11-28-2005 03:03 AM



1 2 3 4 5 6 7 8 9 10 11