我正在尝试使用以下设置:
apache 2.4 + mod_cluster 1.3 Final + ubuntu 14.04.2-server + Wildfly 8.1.0 Final
我成功地将wildfly上下文广告给了apache,但是当我尝试击中负载均衡器时,我得到了500.
此外,当我启动wildfly后重新启动apache时,我收到以下错误:
MODCLUSTER000042: Error MEM sending STATUS command to 192.168.56.101/192.168.56.101:10001, configuration will be reset: MEM: Can't read node
Run Code Online (Sandbox Code Playgroud)
这是我的配置:
mod_cluster.conf
<IfModule manager_module>
Listen *:10001
ManagerBalancerName modcluster
ProxyPass /cluster-demo balancer://modcluster stickysession=JSESSIONID|jsessionid nofailover=On
ProxyPassReverse /cluster-demo balancer://modcluster
ProxyPreserveHost On
<VirtualHost *:10001>
<Location />
Require all granted
</Location>
KeepAliveTimeout 60
MaxKeepAliveRequests 0
EnableMCPMReceive On
AdvertiseFrequency 5
ServerAdvertise On http://192.168.56.101:10001
AdvertiseGroup 224.0.1.105:23364
<Location /mod_cluster-manager>
SetHandler mod_cluster-manager
Require all granted
</Location>
</VirtualHost> …
Run Code Online (Sandbox Code Playgroud) 我正在尝试实现双向客户端 - 服务器程序,其中客户端和服务器可以在彼此之间传递序列化对象.我试图使用Qt(QTcpSocket和QTcpServer)来做到这一点.我在java中实现了这样的程序,但是我无法弄清楚如何使用Qt来实现它.我查看了财富客户端和财富服务器示例......但是从我所看到的,客户端只是发信号通知服务器,服务器向它发送一些数据.我需要客户端和服务器来回发送对象.我不是在寻找一个完整的解决方案,我正在寻找的是一些正确方向的指导.
我写了一些代码,它接受连接但不接受数据.
服务器
这个类是服务器; 它应该接受连接并输出正在发送的缓冲区的大小.但它输出0
#include "comms.h"
Comms::Comms(QString hostIP, quint16 hostPort)
{
server = new QTcpServer(this);
hostAddress.setAddress(hostIP);
this->hostPort = hostPort;
}
void Comms::attemptConnection(){
connect(server, SIGNAL(newConnection()), this, SLOT(connectionAccepted()));
//socket = server->nextPendingConnection();
server->listen(hostAddress,hostPort);
//receivedData = socket->readAll();
}
void Comms::connectionAccepted(){
qDebug()<<"Connected";
socket = new QTcpSocket(server->nextPendingConnection());
char* rec = new char[socket->readBufferSize()];
qDebug()<<socket->readBufferSize();
}
Run Code Online (Sandbox Code Playgroud)
客户
这个类是客户端.应该发送字符串'hello'.它成功发送(据我所知)
#include "toplevelcomms.h"
#include "stdio.h"
TopLevelComms::TopLevelComms(QString hostIP, quint16 hostPort)
{
tcpSocket = new QTcpSocket();
hostAddress.setAddress(hostIP);
this->hostPort = hostPort;
}
void TopLevelComms::connect(){
tcpSocket->connectToHost(hostAddress,hostPort,QIODevice::ReadWrite);
//tcpSocket->waitForConnected(1);
QString …
Run Code Online (Sandbox Code Playgroud) 我的应用程序要求用户在多个屏幕之间切换.我这样做的方法是为每个屏幕创建不同的QFrame,然后将Qframe设置为MainWindow上的中央小部件.问题是,每次调用setCentralWidget(frame)时,旧框架都会被删除,我以后无法访问它.如何保存旧框架以便以后可以访问它?
如果我的问题不清楚,请告诉我.
几个星期前我开始使用Qt,我真的非常喜欢它.我现在需要在我的应用程序中包含图形,经过一些研究,我发现Qwt是最好的方式(而不是自己从头开始做所有事情).我已经在这里工作了几天,我无法弄清楚如何安装它.我使用32位Windows7.我按照INSTALL文件中的说明操作:
来自cmd - >
qmake qwt.pro
nmake
Run Code Online (Sandbox Code Playgroud)
在nmake结束后,我留下了错误
C:\Users\Peyo\Downloads\qwt-6.0.1>qmake qwt.pro
C:\Users\Peyo\Downloads\qwt-6.0.1>nmake
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
cd src\ && "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\nmake.e
xe" -f Makefile
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
"C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\nmake.exe" -f Make
file.Debug all
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
moc qwt_dyngrid_layout.h
moc qwt_magnifier.h
moc qwt_panner.h
moc …
Run Code Online (Sandbox Code Playgroud) 我有一个Qt应用程序,需要能够发送传真.我想知道是否有任何我可以使用的传真库.我一直无法找到明显的解决方案,所以我将非常感谢您的帮助.
该应用程序必须在Windows XP/Windows 7上运行.
如果我不清楚/您需要更多信息,请告诉我.
编辑
会有一台传真机.我不确定传真驱动程序是如何工作的,但应用程序应支持每台传真机.
我正在使用的GPS输出多个NMEA句子,我可以将其用于位置数据.(GPGGA和GPRMC).有理由我应该使用一个而不是另一个吗?我应该检查它们并比较数据吗?我可以选择一个随意使用吗?
在这一点上,我只对lat/lon和时间感兴趣.
如果不清楚我在问什么,请告诉我,我会尽力澄清.
这让我疯了......它早点工作,但不行不通.我已经定义了Q_SLOTS和Q_SIGNALS,我试图连接它们.它工作到一定程度......然后突然间一切都停止了工作,现在我得到了错误.我的代码如下:
ControllerLogic.h
#ifndef CONTROLLERLOGIC_H
#define CONTROLLERLOGIC_H
#include "initdataaccess.h"
#include "mainframe.h"
#include <QtGui>
#include "initializationdatastructure.h"
/** This is a controller class; refering to the model-view-controller
* architecture.
*/
class ControllerLogic : public QObject
{
Q_OBJECT
public:
ControllerLogic(InitDataAccess *initDataAccess, MainFrame *mainFrame);
Q_SIGNALS:
void Signal();
private:
void setMainFrame(MainFrame mainFrame);
public Q_SLOTS:
void receive();
};
#endif // CONTROLLERLOGIC_H
Run Code Online (Sandbox Code Playgroud)
ControllerLogic.cpp
#include "controllerlogic.h"
#include "licensedataaccess.h"
#include <qobjectdefs.h>
// obsolete...may be used later
ControllerLogic::ControllerLogic(InitDataAccess *initDataAccess, MainFrame *mainFrame)
{
connect(this, SIGNAL(signal()), mainFrame, SLOT(PrintTestSlot()));
}
void ControllerLogic::receive(){
qDebug()<<"RECEIVE";
} …
Run Code Online (Sandbox Code Playgroud) 我无法弄清楚为什么我会收到这些错误.我正在使用Qt 4.7.4.我正在尝试创建一个使用套接字进行通信的客户端/服务器程序.我有winsock2库的工作代码(在visual studio 2008中工作).这段代码拒绝使用Qt,我试了几天.我一直在收到链接器错误,所以我决定尝试从头开始使用QTcpSocket.我在.pro文件中包含了所有必需的包含路径,并且我收到了链接器错误.
这是我的客户端类:
toplevelcomms.h
#ifndef TOPLEVELCOMMS_H
#define TOPLEVELCOMMS_H
#include <QObject>
#include "inireader.h"
#include "WinSock2.h"
#include <QDialog>
#include <qtcpsocket.h>
#include <qhostaddress.h>
/** This class sends/receives information through sockets.
*
*/
class TopLevelComms : public QObject
{
Q_OBJECT
public:
TopLevelComms(QString hostIP, quint16 hostPort);
void connect();
private:
QTcpSocket *tcpSocket;
QHostAddress hostAddress;
quint16 hostPort;
};
#endif // TOPLEVELCOMMS_H
Run Code Online (Sandbox Code Playgroud)
toplevelcomms.cpp
#include "toplevelcomms.h"
#include "stdio.h"
TopLevelComms::TopLevelComms(QString hostIP, quint16 hostPort)
{
tcpSocket = new QTcpSocket();
hostAddress.setAddress(hostIP);
this->hostPort = hostPort;
}
void TopLevelComms::connect(){
//tcpSocket->connectToHost();
}
Run Code Online (Sandbox Code Playgroud)
这是.pro文件 …
我正在用Qt创建一个应用程序.我正在使用带有QGraphicsScene的QGraphicsView.我正在对QGraphicsView进行子类化,因为我需要添加自定义鼠标事件功能.我的问题是,当我重新实现鼠标事件功能时,原始的QGraphicsView功能不起作用.
即我重新实现了一些鼠标按下和释放事件,现在我无法拖动QGraphicsScene,即使我有
this->setDragMode(QGraphicsView::ScrollHandDrag);
Run Code Online (Sandbox Code Playgroud)
希望我的问题很清楚,如果不是,请让我知道什么是不清楚的.
当我创建实现QWidget,QGraphicsView,QGraphicsItem等的类时...我总是只包含QtGui而不是QtWidget,QGraphicsView等...这是不好的做法?有任何性能成本吗?因此,构建时间会更长吗?