Re: How peek at tcp socket data w/o reading it

From: Martin Zwickel
Date: Mon Jan 31 2005 - 06:17:30 EST


--Signature_Mon__31_Jan_2005_12_16_16_+0100_HxHGgpsm_yobO0yw
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

On Mon, 31 Jan 2005 11:45:32 +0100
"Kiniger, Karl (GE Healthcare)" <karl.kiniger@xxxxxxxxxx> bubbled:

> Hi,
>=20
> hack wanted:
>=20
> is it possible to peek a few bytes from a tcp socket which is
> ready to read without actually reading the data? (or some
> means to push already read data back similar to ungetc)

ret =3D recv(fd, buf, len, MSG_PEEK);


--=20
MyExcuse:
telnet: Unable to connect to remote host: Connection refused

Martin Zwickel <martin.zwickel@xxxxxxxxxxxxxx>
Research & Development

TechnoTrend AG <http://www.technotrend.de>

--Signature_Mon__31_Jan_2005_12_16_16_+0100_HxHGgpsm_yobO0yw
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFB/hOAmjLYGS7fcG0RAkFbAKCuVqxPQyQ+Nr/a3jrE5p48w6mbSgCgqzE9
zL1msg1nvAyW7vh2IXlKrSQ=
=/3zu
-----END PGP SIGNATURE-----

--Signature_Mon__31_Jan_2005_12_16_16_+0100_HxHGgpsm_yobO0yw--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/