0

I have a websocket server written in C and client also in C. I want to take a picture convert it to binary data , send it through the websocket and decode that picture so other client could see it. Is this possible to be implemented in C, because all the examples that I saw are written in C++ and C#. Thanks in advance

4

1 回答 1

3

然后有趣的是,图片很可能已经是二进制的。

至于发送,它与任何其他套接字通信没有区别。在服务器上,您从文件中读取 X 字节,并将 X 字节发送到客户端。在客户端上,您从服务器读取 X 字节,并将 X 字节写入文件(或缓冲区,如果您只想将数据保存在内存中)。

于 2013-11-14T10:28:54.760 回答