Socket is not working as it should help!

后端 未结 5 2008
南笙
南笙 2020-12-12 05:26

i made a client and server socket based gui app in which screen is captured and via socket it is transfered to desired listner but i am getting a black out put image a recei

5条回答
  •  庸人自扰
    2020-12-12 05:29

    Just because you are sending the image with a single call to Send(...), it's very unlikely (unless the image is small, which if it's a screenshot, it probably isn't) that it will be received completely with a single call to Receive(...) on the client side.

    You will need to call Receive(...) repeatedly, building up the received image buffer until Receive(...) returns 0, indicating that the socket has been closed. You should then have the complete image for display.

提交回复
热议问题