你好,
我在使用AT 命令集时,用8266做客户端,发现建立TCP连接的时候不能指定客户端的端口号,客户端的端口号为一个随机的值。UDP连接是可以制定端口号的,请问TCP连接的端口号为什么不能指定?后面会不会增加此项功能?
谢谢!
8266 TCP 客户端 设置端口号问题
Re: 8266 TCP 客户端 设置端口号问题
Postby ESP_Faye » Tue Jun 23, 2015 11:34 am
您好,
非常抱歉,AT 指令目前不支持设置 TCP 的本地端口。
请问您是有什么特殊的需求,需要指定 TCP 本地端口?
TCP 的本地端口在 TCP 连接断开时,不一定会立即释放,可能需要 2 分钟左右释放。
这样会导致到您指定某 TCP 端口建立连接后,TCP 连接意外断开,此时又使用该端口重连,可能前一次的端口占用还未释放 而 TCP 连接失败。因此一般并不指定 TCP 本地端口,由创建时随机分配空闲端口,以保证连接成功建立。
感谢您对 ESP8266 的关注 !
非常抱歉,AT 指令目前不支持设置 TCP 的本地端口。
请问您是有什么特殊的需求,需要指定 TCP 本地端口?
TCP 的本地端口在 TCP 连接断开时,不一定会立即释放,可能需要 2 分钟左右释放。
这样会导致到您指定某 TCP 端口建立连接后,TCP 连接意外断开,此时又使用该端口重连,可能前一次的端口占用还未释放 而 TCP 连接失败。因此一般并不指定 TCP 本地端口,由创建时随机分配空闲端口,以保证连接成功建立。
感谢您对 ESP8266 的关注 !
Who is online
Users browsing this forum: No registered users and 188 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.