我使用IBM Kitura Framework制作了一个Web应用程序,但该服务只监听IPv4?如何让它在IPv4和IPv6上进行监听?
添加HTTP服务器的源代码如下
template<typename T>
class BTree {
public:
private:
struct Node {
T element;
Node* left, right;
} localNode; // if you want to have an instance of node in your object
Node* root;
Node* getNode();
BTree(); // <- you forget the declaration
};
template<typename T>
BTree<T>::BTree() {
}
// I am stuck on how I would get the getNode() method to work
// I know it's along the lines of...
template<typename T>
typename BTree<T>::Node* BTree<T>::getNode() { // <- needs typename!
return new BTree<T>::Node; // <- simply return the value
// or
return &localNode; // if you have an instance, simply return the address
}
我在我的Ubuntu服务器上运行Kitura.addHTTPServer(onPort: 8090, with: router)
,结果是
lsof -i:8090
它显示8090端口仅侦听IPv4。
答案 0 :(得分:1)
我是IBM的Kitura业务开发经理。 Kitura 2还不支持IPv6。它在Bluesocket和底层框架中得到了支持,但尚未在socket.create()api中实现。这是积压的,并将在不久的将来出现。