TCP Client/Server Image Transfer

后端 未结 5 1220
生来不讨喜
生来不讨喜 2021-01-07 04:04

I\'m trying to send an image using a TCP socket. The client connects to the server without any problems and start to receive the data. The problem is when I try to convert t

5条回答
  •  长发绾君心
    2021-01-07 04:20

    It seems like your server is sending the image over and over again:

    while (client.Connected)
    {
        NetworkStream nStream = client.GetStream();
        nStream.Write(bStream, 0, bStream.Length);
    }
    

    If the server can send data fast enough, the client will probably keep receiving it.

提交回复
热议问题