bool TCPSendRawNode::initialise() { if( !NodeControlBase::initialise() ) { return( false ); } connect( &mSocket, SIGNAL(connected()), this, SLOT(socketConnected()) ); connect( &mSocket, SIGNAL(disconnected()), this, SLOT(socketDisconnected() ) ); connect( &mSocket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(socketError(QAbstractSocket::SocketError)) ); connect( &mSocket, SIGNAL(hostFound()), this, SLOT(socketHostFound()) ); return( true ); }
void ClientListener::newConnection() { m_socket = m_tcpServer->nextPendingConnection(); m_tcpServer->close(); connect(m_socket, SIGNAL(hostFound()), SLOT(socketHostFound())); connect(m_socket, SIGNAL(connected()), SLOT(socketConnected())); connect(m_socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(socketError(QAbstractSocket::SocketError))); connect(m_socket, SIGNAL(readyRead()), SLOT(socketReadyRead())); connect(m_socket, SIGNAL(bytesWritten(qint64)), SLOT(socketBytesWritten(qint64))); connect(m_socket, SIGNAL(disconnected()), SLOT(socketDisconnected())); changeState(Handshaking); m_stream.setDevice(m_socket); }
ShoutCastIODevice::ShoutCastIODevice(void) : m_redirects (0), m_scratchpad_pos (0), m_state (NOT_CONNECTED) { m_socket = new QTcpSocket; m_response = new ShoutCastResponse; connect(m_socket, SIGNAL(hostFound()), SLOT(socketHostFound())); connect(m_socket, SIGNAL(connected()), SLOT(socketConnected())); connect(m_socket, SIGNAL(disconnected()), SLOT(socketConnectionClosed())); connect(m_socket, SIGNAL(readyRead()), SLOT(socketReadyRead())); connect(m_socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(socketError(QAbstractSocket::SocketError))); switchToState(NOT_CONNECTED); setOpenMode(ReadWrite); }