0

I am running a C# server with socket connection to my clients. I want to give them the option to upload images to my server.

But when I start writing the implementation I notice that my socket buffer need to be 1M in order to store all the image data before I even handle it. And this is some thing that scares me a bit...

Is there any good practices for what I am trying to achieve. May be I am doing everything right?

4

1 回答 1

1

我注意到我的套接字缓冲区需要 1M 才能在我处理之前存储所有图像数据。

它不应该。即使,谁在乎?服务器有千兆字节,您不会同时处理数千个上传。

但是不,它不应该是 1mb “必需的”。为什么你会这样想?只需足够快地清空接收缓冲区即可。

于 2013-01-04T11:12:16.707 回答