sockets - 无法从现有 UDP 套接字绑定 UDT 套接字
问题描述
我正在为 UDT 库使用 rust wrapper ( udt-0.1.0 ),但我无法将 UDT 套接字绑定到现有的 UDP 套接字。
use std::net::UdpSocket;
use udt::*; // 0.2.0
fn main() {
let udp_sock = UdpSocket::bind("127.0.0.1:8000").unwrap();
let udt_sock = UdtSocket::new(SocketFamily::AFInet, SocketType::Stream).unwrap();
udt_sock.bind_from(udp_sock).unwrap();
}
每当我尝试执行此代码时,都会遇到错误:
5003: Operation not supported: Bad parameters: Bad file descriptor.
解决方案
推荐阅读
- objective-c - 使用 Kotlin 本机和 ObjectiveC/Swift 的 Optionals/Nullables
- swift - 委托方法,textViewDidChangeSelection 不是每次都触发
- javascript - 试图从javascript中的时间戳数组和价格数组中获取每小时分钟间隔的平均价格
- office-addins - 如何允许我们组织之外的一些用户使用我们的 Excel 加载项
- ruby-on-rails - ActiveStorage Rails 6.1.3 - 我的所有旧图像都收到错误 404 或 500
- leaflet - Esri-leaflet-geocoder:组件未呈现;如何在生产环境中连接供应商
- macos - Intellij 工具窗口“评估表达式”无法打开
- html - 为什么浮动标签会导致
- 在 CSS 中浮动?
- html - div 中的锚标记感觉不像是 div 的一部分
- c# - 从附加到多个游戏对象的一个脚本中调用函数