QAbstractSocket

#include <QtNetwork/QAbstractSocket>

More information will be added here shortly. For now, you'll find more extensive information about this class in the Qt reference for QAbstractSocket


Overview

Inheritance

Public Functions Index

QAbstractSocket (SocketType socketType, QObject *parent)
virtual ~QAbstractSocket ()
voidabort ()
virtual boolatEnd () const
virtual qint64bytesAvailable () const
virtual qint64bytesToWrite () const
virtual boolcanReadLine () const
virtual voidclose ()
voidconnectToHost (const QString &hostName, quint16 port, OpenMode mode=ReadWrite)
voidconnectToHost (const QHostAddress &address, quint16 port, OpenMode mode=ReadWrite)
voiddisconnectFromHost ()
SocketErrorerror () const
boolflush ()
virtual boolisSequential () const
boolisValid () const
QHostAddresslocalAddress () const
quint16localPort () const
QHostAddresspeerAddress () const
QStringpeerName () const
quint16peerPort () const
QNetworkProxyproxy () const
qint64readBufferSize () const
voidsetProxy (const QNetworkProxy &networkProxy)
voidsetReadBufferSize (qint64 size)
boolsetSocketDescriptor (int socketDescriptor, SocketState state=ConnectedState, OpenMode openMode=ReadWrite)
voidsetSocketOption (QAbstractSocket::SocketOption option, const QVariant &value)
intsocketDescriptor () const
QVariantsocketOption (QAbstractSocket::SocketOption option)
SocketTypesocketType () const
SocketStatestate () const
virtual boolwaitForBytesWritten (int msecs=30000)
boolwaitForConnected (int msecs=30000)
boolwaitForDisconnected (int msecs=30000)
virtual boolwaitForReadyRead (int msecs=30000)
QStringerrorString () const Inherited
boolgetChar (char *c)Inherited
boolisOpen () const Inherited
boolisReadable () const Inherited
boolisTextModeEnabled () const Inherited
boolisWritable () const Inherited
virtual boolopen (OpenMode mode)Inherited
OpenModeopenMode () const Inherited
qint64peek (char *data, qint64 maxlen)Inherited
QByteArraypeek (qint64 maxlen)Inherited
virtual qint64pos () const Inherited
boolputChar (char c)Inherited
QIODevice ()Inherited
QIODevice (QObject *parent)Inherited
qint64read (char *data, qint64 maxlen)Inherited
QByteArrayread (qint64 maxlen)Inherited
QByteArrayreadAll ()Inherited
qint64readLine (char *data, qint64 maxlen)Inherited
QByteArrayreadLine (qint64 maxlen=0)Inherited
virtual boolreset ()Inherited
virtual boolseek (qint64 pos)Inherited
voidsetTextModeEnabled (bool enabled)Inherited
virtual qint64size () const Inherited
voidungetChar (char c)Inherited
qint64write (const char *data, qint64 len)Inherited
qint64write (const char *data)Inherited
qint64write (const QByteArray &data)Inherited

Protected Functions Index

QAbstractSocket (SocketType socketType, QAbstractSocketPrivate &dd, QObject *parent=0)
virtual qint64readData (char *data, qint64 maxlen)
virtual qint64readLineData (char *data, qint64 maxlen)
voidsetLocalAddress (const QHostAddress &address)
voidsetLocalPort (quint16 port)
voidsetPeerAddress (const QHostAddress &address)
voidsetPeerName (const QString &name)
voidsetPeerPort (quint16 port)
voidsetSocketError (SocketError socketError)
voidsetSocketState (SocketState state)
virtual qint64writeData (const char *data, qint64 len)
QIODevice (QIODevicePrivate &dd, QObject *parent=0)Inherited
voidsetErrorString (const QString &errorString)Inherited
voidsetOpenMode (OpenMode openMode)Inherited

Signals Index

voidconnected ()
voiddisconnected ()
voiderror (QAbstractSocket::SocketError)
voidhostFound ()
voidproxyAuthenticationRequired (const QNetworkProxy &proxy, QAuthenticator *authenticator)
voidstateChanged (QAbstractSocket::SocketState)
voidaboutToClose ()Inherited
voidbytesWritten (qint64 bytes)Inherited
voidreadChannelFinished ()Inherited
voidreadyRead ()Inherited

Public Types

NetworkLayerProtocol

IPv4Protocol
IPv6Protocol
UnknownNetworkLayerProtocol -1

SocketError

ConnectionRefusedError
RemoteHostClosedError
HostNotFoundError
SocketAccessError
SocketResourceError
SocketTimeoutError
DatagramTooLargeError
NetworkError
AddressInUseError
SocketAddressNotAvailableError
UnsupportedSocketOperationError
UnfinishedSocketOperationError
ProxyAuthenticationRequiredError
SslHandshakeFailedError
ProxyConnectionRefusedError
ProxyConnectionClosedError
ProxyConnectionTimeoutError
ProxyNotFoundError
ProxyProtocolError
UnknownSocketError -1

SocketOption

LowDelayOption
KeepAliveOption
MulticastTtlOption
MulticastLoopbackOption

SocketState

UnconnectedState
HostLookupState
ConnectingState
ConnectedState
BoundState
ListeningState
ClosingState

SocketType

TcpSocket
UdpSocket
UnknownSocketType -1

OpenModeFlag Inherited

NotOpen 0x0000
ReadOnly 0x0001
WriteOnly 0x0002
ReadWrite ReadOnly | WriteOnly
Append 0x0004
Truncate 0x0008
Text 0x0010
Unbuffered 0x0020

Public Functions

QAbstractSocket (
  • SocketTypesocketType,
  • QObject *parent )

virtual~QAbstractSocket ()

Destructor.

void abort ()

virtual bool atEnd ()

virtual qint64 bytesAvailable ()

virtual qint64 bytesToWrite ()

virtual bool canReadLine ()

virtual void close ()

void connectToHost (
  • const QString &hostName,
  • quint16port,
  • OpenModemode )

void connectToHost (

void disconnectFromHost ()

SocketError error ()

bool flush ()

virtual bool isSequential ()

bool isValid ()

QHostAddress localAddress ()

quint16 localPort ()

QHostAddress peerAddress ()

QString peerName ()

quint16 peerPort ()

QNetworkProxy proxy ()

qint64 readBufferSize ()

void setProxy (

void setReadBufferSize (
  • qint64size)

bool setSocketDescriptor (
  • intsocketDescriptor,
  • SocketStatestate,
  • OpenModeopenMode )

void setSocketOption (
  • QAbstractSocket::SocketOptionoption,
  • const QVariant &value )

int socketDescriptor ()

QVariant socketOption (
  • QAbstractSocket::SocketOptionoption)

SocketType socketType ()

SocketState state ()

virtual bool waitForBytesWritten (
  • intmsecs)

bool waitForConnected (
  • intmsecs)

bool waitForDisconnected (
  • intmsecs)

virtual bool waitForReadyRead (
  • intmsecs)

QString errorString ()Inherited

bool getChar (
  • char *c)
Inherited

bool isOpen ()Inherited

bool isReadable ()Inherited

bool isTextModeEnabled ()Inherited

bool isWritable ()Inherited

virtual bool open (
  • OpenModemode)
Inherited

OpenMode openMode ()Inherited

qint64 peek (
  • char *data,
  • qint64maxlen )
Inherited

QByteArray peek (
  • qint64maxlen)
Inherited

virtual qint64 pos ()Inherited

bool putChar (
  • charc)
Inherited

QIODevice ()Inherited

QIODevice (Inherited

qint64 read (
  • char *data,
  • qint64maxlen )
Inherited

QByteArray read (
  • qint64maxlen)
Inherited

QByteArray readAll ()Inherited

qint64 readLine (
  • char *data,
  • qint64maxlen )
Inherited

QByteArray readLine (
  • qint64maxlen)
Inherited

virtual bool reset ()Inherited

virtual bool seek (
  • qint64pos)
Inherited

void setTextModeEnabled (
  • boolenabled)
Inherited

virtual qint64 size ()Inherited

void ungetChar (
  • charc)
Inherited

qint64 write (
  • const char *data,
  • qint64len )
Inherited

qint64 write (
  • const char *data)
Inherited

qint64 write (Inherited

Protected Functions

QAbstractSocket (
  • SocketTypesocketType,
  • QAbstractSocketPrivate &dd,
  • QObject *parent )

virtual qint64 readData (
  • char *data,
  • qint64maxlen )

virtual qint64 readLineData (
  • char *data,
  • qint64maxlen )

void setLocalAddress (

void setLocalPort (
  • quint16port)

void setPeerAddress (

void setPeerName (

void setPeerPort (
  • quint16port)

void setSocketError (
  • SocketErrorsocketError)

void setSocketState (
  • SocketStatestate)

virtual qint64 writeData (
  • const char *data,
  • qint64len )

QIODevice (
  • QIODevicePrivate &dd,
  • QObject *parent )
Inherited

void setErrorString (Inherited

void setOpenMode (
  • OpenModeopenMode)
Inherited

Signals

void connected ()

void disconnected ()

void error (
  • QAbstractSocket::SocketError)

void hostFound ()

void proxyAuthenticationRequired (

void stateChanged (
  • QAbstractSocket::SocketState)

void aboutToClose ()Inherited

void bytesWritten (
  • qint64bytes)
Inherited

void readChannelFinished ()Inherited

void readyRead ()Inherited

Last modified: 2015-07-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus