收到插座 [英] Receiveing sockets

查看:73
本文介绍了收到插座的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如果我在客户端使用client.Server.SendFile(),我如何在服务器端接收它?

谢谢

Hi,

If I use client.Server.SendFile() on the client side, how do I receive it on the server side??

Thanks

推荐答案

我总是想知道同样的事情(关于WinSock TransmitFile函数)。我猜它只会加载文件的数据并发送它。

为了方便地接收它,你必须首先发送文件的长度,然后调用SendFile。接收方将看到长度,然后将那么多字节重定向到目标文件。

无论如何,这就是我猜的。我从来没有见过一个完整的样本来证明这一点。

-Steve
I've always wondered the same thing (about the WinSock TransmitFile function). I'm guessing it would just load the file's data and send it.

In order to easily receive it, you'd have to first send the length of the file and then call SendFile. The receiving side would see the length and then redirect that many bytes to the destination file.

That's what I'm guessing, anyway. I've never seen a complete sample that demonstrates this.

       -Steve


这篇关于收到插座的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆