本文整理汇总了C++中Connected函数的典型用法代码示例。如果您正苦于以下问题:C++ Connected函数的具体用法?C++ Connected怎么用?C++ Connected使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Connected函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QTcpSocket
Client::Client(QString name)
{
this->name=name;
socket = new QTcpSocket(this);
connect(socket, SIGNAL(readyRead()), this, SLOT(readyRead()));
connect(socket, SIGNAL(connected()), this, SIGNAL(Connected()));
connect(socket, SIGNAL(connected()), this, SLOT(SendUsernameToServer()));
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SIGNAL(ConnectionFailed()));
connect(socket,SIGNAL(disconnected()),this,SIGNAL(Disconnected()));
}
示例2: run_topology
/** Loop through all objects and check their topology. */
void
run_topology(void)
{
int ndone;
for (ndone = 0; ndone < db_top; ndone++) {
if (!IsGarbage(ndone) && Connected(Owner(ndone)) && !NoWarn(Owner(ndone))) {
check_topology_on(Owner(ndone), ndone);
}
}
}
示例3: QObject
IP_Connection::IP_Connection(QObject *parent) :
QObject(parent)
{
IP_Init();
connect(socket, SIGNAL(connected()), this, SIGNAL(Connected()));
connect(socket, SIGNAL(disconnected()), this, SIGNAL(Disconnected()));
connect(socket, SIGNAL(disconnected()), this, SLOT(sdisconnected()));
connect(socket, SIGNAL(readyRead()), this, SIGNAL(dataReceived()));
}
示例4: ConnectionPort
// -------------------------------------------------------------------
// ConnectionPort
// -------------------------------------------------------------------
long int BitSwarmClient::ConnectionPort()
{
if (!Connected())
{
return -1;
}
else
{
return lastTcpPort;
}
}
示例5: connect
void IsuCalcLink::Initialize()
{
Socket = new QTcpSocket;
connect(Socket, SIGNAL(connected()), this, SLOT(Connected()));
connect(Socket, SIGNAL(disconnected()), this, SLOT(Disconnected()));
connect(Socket, SIGNAL(readyRead()), this, SLOT(ReadyRead()));
connect(Socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(SocketError(QAbstractSocket::SocketError)));
Timer = new QTimer;
Timer->setSingleShot(true);
connect(Timer, SIGNAL(timeout()), this, SLOT(TimerExpired()));
}
示例6: string
// -------------------------------------------------------------------
// ConnectionIp
// -------------------------------------------------------------------
boost::shared_ptr<string> BitSwarmClient::ConnectionIp()
{
if (!Connected())
{
return boost::shared_ptr<string>(new string("Not Connected"));
}
else
{
return boost::shared_ptr<string>(new string(*lastIpAddress));
}
}
示例7: SendPacket
bool EmuTCPConnection::SendPacket(EmuTCPNetPacket_Struct* tnps)
{
if (RemoteID)
{
return false;
}
if (!Connected())
{
return false;
}
if (GetMode() != modePacket)
{
return false;
}
LockMutex lock(&MState);
eTCPMode tmp = GetMode();
if (tmp == modeTransition)
{
EmuTCPNetPacket_Struct* tnps2 = (EmuTCPNetPacket_Struct*) new uchar[tnps->size];
memcpy(tnps2, tnps, tnps->size);
InModeQueuePush(tnps2);
return true;
}
#if TCPN_LOG_PACKETS >= 1
if (tnps && tnps->opcode != 0)
{
struct in_addr in;
in.s_addr = GetrIP();
CoutTimestamp(true);
std::cout << ": Logging outgoing TCP NetPacket. OPCode: 0x" << std::hex << std::setw(4) << std::setfill('0') << tnps->opcode << std::dec << ", size: " << std::setw(5) << std::setfill(' ') << tnps->size << " " << inet_ntoa(in) << ":" << GetrPort();
if (pOldFormat)
{
std::cout << " (OldFormat)";
}
std::cout << std::endl;
#if TCPN_LOG_PACKETS == 2
if (tnps->size >= 32)
{
DumpPacket((uchar*) tnps, 32);
}
else
{
DumpPacket((uchar*) tnps, tnps->size);
}
#endif
#if TCPN_LOG_PACKETS >= 3
DumpPacket((uchar*) tnps, tnps->size);
#endif
}
#endif
ServerSendQueuePushEnd((const uchar*) tnps, tnps->size);
return true;
}
示例8: NM_COMMENT
// ----------------------------------------------------------------------------
// CIpsPlgImap4ConnectOp::DoConnectOpL()
// ----------------------------------------------------------------------------
//
void CIpsPlgImap4ConnectOp::DoConnectOpL()
{
FUNC_LOG;
iBaseMtm->SwitchCurrentEntryL( iService );
iSelection->ResizeL(0);
iSelection->AppendL(iService);
// <qmail>
iStatus = KRequestPending;
if ( iDoPlainConnect && !Connected() )
{
TBuf8<1> parameter;
NM_COMMENT("CIpsPlgImap4ConnectOp: do plain connect");
// connect and synchronise starts background sync or idle
iSubOperation = iBaseMtm->InvokeAsyncFunctionL(
KIMAP4MTMConnect, *iSelection, parameter, iStatus);
}
else if ( Connected() )
{
// in this point cant use "connect and do something" commands,
// use regular sync, when new mails is populated elsewhere.
TBuf8<1> parameter;
NM_COMMENT("CIpsPlgImap4ConnectOp: full sync starting");
iSubOperation = iBaseMtm->InvokeAsyncFunctionL(
KIMAP4MTMFullSync, *iSelection, parameter, iStatus);
}
else
{
// the used command requires an observer to be given even though we're not using it
NM_COMMENT("CIpsPlgImap4ConnectOp: connect and sync");
TPckg<MMsvImapConnectionObserver*> parameter( NULL );
iSubOperation = iBaseMtm->InvokeAsyncFunctionL(
KIMAP4MTMConnectAndSyncCompleteAfterFullSync,
*iSelection, parameter, iStatus );
}
SignalSyncStarted();
iState = EStateConnectAndSync;
SetActive();
// </qmail>
}
示例9: InitLoginServer
bool LoginServer::InitLoginServer() {
if(Connected() == false) {
if(ConnectReady()) {
Log.Out(Logs::Detail, Logs::World_Server, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort);
Connect();
} else {
Log.Out(Logs::Detail, Logs::World_Server, "Not connected but not ready to connect, this is bad: %s:%d",
LoginServerAddress,LoginServerPort);
}
}
return true;
}
示例10: OnConnected
void WorldConnection::Process() {
//persistent connection....
if (!Connected()) {
pConnected = tcpc.Connected();
if (pConnected) {
OnConnected();
}
else
return;
}
}
示例11: QWidget
//Constructor
phAnalyzer::phAnalyzer(QWidget *parent, Qt::WFlags flags) : QWidget(parent, flags), inj(0)
{
//Sets up the UI
ui.setupUi(this);
//Get absolute path to application
QString path = QApplication::applicationFilePath();
path = path.replace(path.mid(path.lastIndexOf("/")), "");
//Load settings
QSettings settings(path + "/phAnalyzer.ini", QSettings::IniFormat);
HOST = settings.value("phAnalyzer/Host").toString();
PORT = settings.value("phAnalyzer/Port").toUInt();
//Make sure the host/IP is not empty
if(HOST.isEmpty())
{
//Set default IP
settings.setValue("phAnalyzer/Host", "127.0.0.1");
HOST = "127.0.0.1";
}
//Make sure the port is not null
if(PORT == 0)
{
//Set default port
settings.setValue("phAnalyzer/Port", 22580);
PORT = 22580;
}
//Connect file menu actions
connect(ui.actionSave, SIGNAL(triggered()), this, SLOT(Save()));
connect(ui.actionInject, SIGNAL(triggered()), this, SLOT(Inject()));
connect(ui.actionExit, SIGNAL(triggered()), this, SLOT(close()));
//Connect right click menu for removing opcodes
connect(ui.lstIgnore, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(RemoveOpcodeMenu(const QPoint &)));
connect(ui.lstListen, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(RemoveOpcodeMenu(const QPoint &)));
//New socket
socket = new QTcpSocket(this);
//Create the injection UI
inj = new injection(0, socket);
//Setup the connection slots
connect(socket, SIGNAL(connected()), this, SLOT(Connected()));
connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(SocketState(QAbstractSocket::SocketState)));
connect(socket, SIGNAL(readyRead()), this, SLOT(readyRead()));
//Connect
socket->connectToHost(HOST, PORT);
}
示例12: InitLoginServer
bool LoginServer::InitLoginServer() {
if(Connected() == false) {
if(ConnectReady()) {
_log(WORLD__LS, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort);
Connect();
} else {
_log(WORLD__LS_ERR, "Not connected but not ready to connect, this is bad: %s:%d",
LoginServerAddress,LoginServerPort);
}
}
return true;
}
示例13: addPair
//================================================================================================================================================================
bool UnionFindTemplate::addPair(int p, int q)
{
if(!Connected(p, q))
{
Union(p, q);
nrUnionOperations++;
return true;
}
else
return false;
}
示例14:
void Vrc4::Irq::SaveState(State::Saver& state,const dword chunk) const
{
const byte data[5] =
{
unit.ctrl | (Connected() ? BaseIrq::ENABLE_0 : 0),
unit.latch,
unit.count[0] & 0xFF,
unit.count[0] >> 8,
unit.count[1]
};
state.Begin( chunk ).Write( data ).End();
}
示例15: Send
bool TCPConnection::Send(const uchar* data, int32 size)
{
if (!Connected())
{
return false;
}
if (!size)
{
return true;
}
ServerSendQueuePushEnd(data, size);
return true;
}