• 4751阅读
  • 6回复

[提问]QTcpSocket客户端端口问题 [复制链接]

上一主题 下一主题
离线x_y_x
 
只看楼主 正序阅读 楼主  发表于: 2013-03-30
使用QTcpSocket类与服务器连接时,怎样在客户端使用指定的端口?
离线x_y_x
只看该作者 6楼 发表于: 2013-04-01
错误: ‘void QAbstractSocket::setLocalPort(quint16)’是保护的
离线ffii4455

只看该作者 5楼 发表于: 2013-04-01
回 4楼(x_y_x) 的帖子
You can call this function in a subclass of QAbstractSocket to change the return value of the localPort() function after a connection has been established. This feature is commonly used by proxy connections for virtual connection settings.
离线x_y_x
只看该作者 4楼 发表于: 2013-04-01
回 3楼(pxiao_xiao) 的帖子
setLocalPort ( quint16 port ) 是protected,没法直接调用啊。。
离线pxiao_xiao

只看该作者 3楼 发表于: 2013-03-31
setLocalPort ( quint16 port )
离线x_y_x
只看该作者 2楼 发表于: 2013-03-30
回 1楼(空空空) 的帖子
我的问题是指定客户端的端口,不是要连接的服务器端的端口
离线空空空
只看该作者 1楼 发表于: 2013-03-30
tcpClient->connectToHost(serverNode.ipAddress, serverNode.port);
快速回复
限100 字节
 
上一个 下一个