[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTi=40758wF4Z6GDfm809miA-hnCnSQdwA9bALX0+@mail.gmail.com>
Date: Mon, 8 Nov 2010 12:38:47 +0530
From: ranjith kumar <ranjithproxy@...il.com>
To: linux-kernel <linux-kernel@...r.kernel.org>
Subject: how to read one udp packet with more than one recvfrom() calls?
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.
Download attachment "client.c" of type "application/octet-stream" (1169 bytes)
Download attachment "server.c" of type "application/octet-stream" (1083 bytes)
Powered by blists - more mailing lists