Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In tcp, one receive buffer for each connection? Or all the connections share one buffer?

Tags:

tcp

buffer

For example, in the server endpoint, if I set the receive buffer size to 1k, and there are 100 connections, are these 100 connections share this 1k receive buffer? Or each connection has its own 1k receive buffer? And is it same for send buffer?

like image 489
haibo cu Avatar asked Sep 16 '25 08:09

haibo cu


1 Answers

For example, in the server endpoint, if I set the receive buffer size 1k, and there is 100 connections. Is these 100 connections share this 1k receive buffer?

No.

Or each connection has their own 1k receive buffer?

See below.

And is it same for send buffer?

Yes.

Every socket has its own send and receive buffer. That's why you have to specify the socket when setting or getting them.

like image 62
user207421 Avatar answered Sep 19 '25 14:09

user207421