本文介绍了Network.Socket.ByteString.Lazy的sendTo在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Network.Socket.ByteStringNetwork.Socket.ByteString.Lazy都具有send功能.

Network.Socket.ByteString具有sendTo功能,但Network.Socket.ByteString.Lazy没有.

如何将Network.Socket.ByteString的sendTo与Lazy.ByteString Network.Socket.ByteString.Lazysend函数一起使用. (即我如何告诉它将数据包发送到哪里.)

How can I use Network.Socket.ByteString's sendTo with a Lazy.ByteString or Network.Socket.ByteString.Lazy's send function. (i.e. how do I tell it where to send the packet.)

任何人都可以推荐有关Haskell的Strings,BytesStrings的很好的教程. Lazy.ByteStrings等,我发现它们非常令人困惑(来自Java/Python背景).

Can anyone recommend a good tutorial on Haskell's Strings, BytesStrings. Lazy.ByteStrings, etc. as I find them very confusing (coming from a Java/Python background).

推荐答案

请注意,sendTo在发送的数据中是严格的,因此没有真正的逻辑将其传递为惰性字节串.这就是为什么该函数仅存在于严格的字节串上的原因.

Note that sendTo is strict in the data sent, and so there's no real logic to passing it a lazy bytestring. That's why the function only exists on strict bytestrings.

这篇关于Network.Socket.ByteString.Lazy的sendTo在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 01:52