本文整理汇总了C++中setServer函数的典型用法代码示例。如果您正苦于以下问题:C++ setServer函数的具体用法?C++ setServer怎么用?C++ setServer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setServer函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setServer
bool Camera_INDIClass::Connect(const wxString& camId)
{
// If not configured open the setup dialog
if (strcmp(INDICameraName,"INDI Camera")==0) CameraSetup();
// define server to connect to.
setServer(INDIhost.mb_str(wxConvUTF8), INDIport);
// Receive messages only for our camera.
watchDevice(INDICameraName.mb_str(wxConvUTF8));
// Connect to server.
if (connectServer()) {
return !ready;
}
else {
// last chance to fix the setup
CameraSetup();
setServer(INDIhost.mb_str(wxConvUTF8), INDIport);
watchDevice(INDICameraName.mb_str(wxConvUTF8));
if (connectServer()) {
return !ready;
}
else {
return true;
}
}
}
示例2: SetupDialog
bool ScopeINDI::Connect()
{
// If not configured open the setup dialog
if (INDIMountName == wxT("INDI Mount")) {
SetupDialog();
}
// define server to connect to.
setServer(INDIhost.mb_str(wxConvUTF8), INDIport);
// Receive messages only for our mount.
watchDevice(INDIMountName.mb_str(wxConvUTF8));
// Connect to server.
if (connectServer()) {
return !ready;
}
else {
// last chance to fix the setup
SetupDialog();
setServer(INDIhost.mb_str(wxConvUTF8), INDIport);
watchDevice(INDIMountName.mb_str(wxConvUTF8));
if (connectServer()) {
return !ready;
}
else {
return true;
}
}
}
示例3: setDict
bool DictEngine::sourceRequestEvent(const QString &query)
{
// FIXME: this is COMPLETELY broken .. it can only look up one query at a time!
// a DataContainer subclass that does the look up should probably be made
if (m_currentQuery == query) {
return false;
}
if (m_tcpSocket) {
m_tcpSocket->abort(); //stop if lookup is in progress and new query is requested
m_tcpSocket->deleteLater();
m_tcpSocket = 0;
}
QStringList queryParts = query.split(':', QString::SkipEmptyParts);
if (queryParts.isEmpty()) {
return false;
}
m_currentWord = queryParts.last();
m_currentQuery = query;
//asked for a dictionary?
if (queryParts.count() > 1) {
setDict(queryParts[queryParts.count()-2]);
//default to wordnet
} else {
setDict(QStringLiteral("wn"));
}
//asked for a server?
if (queryParts.count() > 2) {
setServer(queryParts[queryParts.count()-3]);
//default to wordnet
} else {
setServer(QStringLiteral("dict.org"));
}
if (m_currentWord.simplified().isEmpty()) {
setData(m_currentWord, m_dictName, QString());
} else {
setData(m_currentWord, m_dictName, QString());
m_tcpSocket = new QTcpSocket(this);
m_tcpSocket->abort();
connect(m_tcpSocket, &QTcpSocket::disconnected, this, &DictEngine::socketClosed);
if (m_currentWord == QLatin1String("list-dictionaries")) {
connect(m_tcpSocket, &QTcpSocket::readyRead, this, &DictEngine::getDicts);
} else {
connect(m_tcpSocket, &QTcpSocket::readyRead, this, &DictEngine::getDefinition);
}
m_tcpSocket->connectToHost(m_serverName, 2628);
}
return true;
}
示例4: configTime
void configTime(int timezone, int daylightOffset_sec, const char* server1, const char* server2, const char* server3)
{
sntp_stop();
setServer(0, server1);
setServer(1, server2);
setServer(2, server3);
sntp_set_timezone(timezone/3600);
sntp_set_daylight(daylightOffset_sec);
sntp_init();
}
示例5: setServerUser
bool Contact::setAddress(const QString &address)
{
QStringList addressParts = address.split("@");
if (addressParts.count() == 2) {
setServerUser(addressParts[0]);
setServer(addressParts[1]);
} else {
setServerUser("");
setServer("");
}
}
示例6: configTime
void WEAK_ATTR configTime(int timezone, int daylightOffset_sec, const char* server1, const char* server2, const char* server3)
{
sntp_stop();
setServer(0, server1);
setServer(1, server2);
setServer(2, server3);
s_timezone_sec = timezone;
s_daylightOffset_sec = daylightOffset_sec;
sntp_set_timezone(timezone/3600);
sntp_init();
}
示例7: onClickbtnLogin
/*************************************************
Function Name: onClickbtnLogin()
Description: 单击“登录”按钮
Input: NULL
Output: NULL
Changes: NULL
*************************************************/
void IMLoginWidget::onClickBtnLogin()
{
setServer();
m_leUserID->setReadOnly(true);
m_leUserPwd->setReadOnly(true);
// m_btnLogin->setEnabled(false);
if (true == m_isLogin)
{
m_isLogin = false;
m_btnLogin->setText(tr("取消"));
m_closeTimer = false;
m_timerID=startTimer(1000);//interval is 100ms
// IMClientMessageCtrl::sm_hostAddress = address;
// IMClientMessageCtrl::sm_hostPort = port;
m_labelStatus->setText(tr("登录中"));
if (m_loginCtrl == NULL)
{
m_loginCtrl = new IMLoginCtrl(this);
connect(m_loginCtrl, SIGNAL(getLoginMessgae(QString,bool,const UserInformation*)),
this, SLOT(setLabelStatus(QString,bool,const UserInformation*)));
}
示例8: setServer
PubSubClient::PubSubClient(const char* domain, uint16_t port, Client& client, Stream& stream) {
this->_state = MQTT_DISCONNECTED;
setServer(domain,port);
setClient(client);
setStream(stream);
setListener(NULL); // TOAST
}
示例9: setServer
MqttClient::MqttClient(const char* domain, uint16_t port, MQTT_CALLBACK_SIGNATURE, Nokia_MqttClientAdapter& client) {
this->_state = MQTT_DISCONNECTED;
setServer(domain,port);
setCallback(callback);
setClient(client);
this->stream = NULL;
}
示例10: setServer
PubSubClient::PubSubClient(const char* domain, uint16_t port, Client& client)
{
this->_state = MQTT_DISCONNECTED;
setServer(domain,port);
setClient(client);
this->stream = NULL;
}
示例11: setServer
PubSubClient::PubSubClient(uint8_t *ip, uint16_t port, Client& client, Stream& stream) {
this->_state = MQTT_DISCONNECTED;
setServer(ip,port);
setClient(client);
setStream(stream);
setProtocol(MQTT_VERSION);
}
示例12: setServer
GameScripting::GameScripting(Server* server)
{
setServer(server);
// setEnv(env) is called by ScriptApiEnv::initializeEnvironment()
// once the environment has been created
SCRIPTAPI_PRECHECKHEADER
if (g_settings->getBool("secure.enable_security")) {
initializeSecurity();
}
lua_getglobal(L, "core");
int top = lua_gettop(L);
lua_newtable(L);
lua_setfield(L, -2, "object_refs");
lua_newtable(L);
lua_setfield(L, -2, "luaentities");
// Initialize our lua_api modules
InitializeModApi(L, top);
lua_pop(L, 1);
// Push builtin initialization type
lua_pushstring(L, "game");
lua_setglobal(L, "INIT");
infostream << "SCRIPTAPI: Initialized game modules" << std::endl;
}
示例13: setServer
PubSubClient::PubSubClient(uint8_t *ip, uint16_t port, MQTT_CALLBACK_SIGNATURE, Client& client) {
this->_state = MQTT_DISCONNECTED;
setServer(ip, port);
setCallback(callback);
setClient(client);
this->stream = NULL;
}
示例14: MyProxy
MyProxy(ISocketHandler &h)
: ProxyClient(h)
{
setServer("evocraft.net");
addTimer(NULL, 1.0f, 0);
}
示例15: setServer
GameScripting::GameScripting(Server* server)
{
setServer(server);
// setEnv(env) is called by ScriptApiEnv::initializeEnvironment()
// once the environment has been created
//TODO add security
luaL_openlibs(getStack());
SCRIPTAPI_PRECHECKHEADER
// Create the main minetest table
lua_newtable(L);
lua_newtable(L);
lua_setfield(L, -2, "object_refs");
lua_newtable(L);
lua_setfield(L, -2, "luaentities");
lua_setglobal(L, "minetest");
// Initialize our lua_api modules
lua_getglobal(L, "minetest");
int top = lua_gettop(L);
InitializeModApi(L, top);
lua_pop(L, 1);
infostream << "SCRIPTAPI: initialized game modules" << std::endl;
}