lkml.org 
[lkml]   [2010]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: how to read one udp packet with more than one recvfrom() calls?
Date
try MSG_PEEK option.

Regards,
Varun

On Monday, November 08, 2010 12:38:47 pm ranjith kumar wrote:
> Hi,
>
> I have implemented client and server programs using udp
> protocol(files are attached).
> UDP packet size is 500bytes.
>
> I want to read these 500bytes in two calls to recvfrom(). First time
> reading 100bytes and second time 400bytes.
> How to do this?
>
> When I tried to change the third argument of recvfrom(size_t len),
> from 500 to 100, first 100bytes are read correctly.
> But when I call recvfrom() second time with len=400, it is reading the
> first 400bytes of "next udp packet".
> Why? Isn't it possible to read one udp packet in two calls to
> recvfrom()/read()????
>
> Thanks in advance.
>


\
 
 \ /
  Last update: 2010-11-09 06:39    [W:0.048 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site