KDE 4.3 PyKDE API Reference
  • KDE's Python API
  • Overview
  • PyKDE Home
  • Sitemap
  • Contact Us
 

KTcpSocket Class Reference

from PyKDE4.kdecore import *

Inherits: QIODevice → QObject

Detailed Description


Enumerations

EncryptionMode { UnencryptedMode, SslClientMode, SslServerMode }
Error { UnknownError, ConnectionRefusedError, RemoteHostClosedError, HostNotFoundError, SocketAccessError, SocketResourceError, SocketTimeoutError, NetworkError, UnsupportedSocketOperationError }
ProxyPolicy { AutoProxy, ManualProxy }
SslVersion { UnknownSslVersion, SslV2, SslV3, TlsV1, SslV3_1, AnySslVersion }
Typesafe wrapper: SslVersions
State { UnconnectedState, HostLookupState, ConnectingState, ConnectedState, BoundState, ListeningState, ClosingState }

Signals

 aboutToClose ()
 bytesWritten (long bytes)
 connected ()
 disconnected ()
 encrypted ()
 encryptionModeChanged (KTcpSocket.EncryptionMode a0)
 error (KTcpSocket.Error a0)
 hostFound ()
 proxyAuthenticationRequired (QNetworkProxy proxy, QAuthenticator authenticator)
 readyRead ()
 sslErrors ([KSslError] errors)
 stateChanged (KTcpSocket.State a0)

Methods

 __init__ (self, QObject parent=0)
 abort (self)
 aboutToClose (self)
 addCaCertificate (self, QSslCertificate certificate)
 addCaCertificates (self, [QSslCertificate] certificates)
KTcpSocket.SslVersion advertisedSslVersion (self)
bool atEnd (self)
long bytesAvailable (self)
long bytesToWrite (self)
 bytesWritten (self, long bytes)
[QSslCertificate] caCertificates (self)
bool canReadLine (self)
[KSslCipher] ciphers (self)
 close (self)
 connectToHost (self, QString hostName, int port, KTcpSocket.ProxyPolicy policy=KTcpSocket.AutoProxy)
 connectToHost (self, QHostAddress hostAddress, int port, KTcpSocket.ProxyPolicy policy=KTcpSocket.AutoProxy)
 connectToHost (self, KUrl url, KTcpSocket.ProxyPolicy policy=KTcpSocket.AutoProxy)
 connectToHostEncrypted (self, QString hostName, int port, QIODevice.OpenMode openMode=QIODevice.ReadWrite)
 connected (self)
 disconnectFromHost (self)
 disconnected (self)
 encrypted (self)
KTcpSocket.EncryptionMode encryptionMode (self)
 encryptionModeChanged (self, KTcpSocket.EncryptionMode a0)
KTcpSocket.Error error (self)
 error (self, KTcpSocket.Error a0)
bool flush (self)
 hostFound (self)
 ignoreSslErrors (self)
bool isSequential (self)
bool isValid (self)
QHostAddress localAddress (self)
QSslCertificate localCertificate (self)
KTcpSocket.SslVersion negotiatedSslVersion (self)
QString negotiatedSslVersionName (self)
bool open (self, QIODevice.OpenMode open)
QHostAddress peerAddress (self)
[QSslCertificate] peerCertificateChain (self)
QString peerName (self)
int peerPort (self)
KSslKey privateKey (self)
QNetworkProxy proxy (self)
 proxyAuthenticationRequired (self, QNetworkProxy proxy, QAuthenticator authenticator)
long readBufferSize (self)
long readData (self, QString data, long maxSize)
 readyRead (self)
KSslCipher sessionCipher (self)
 setAdvertisedSslVersion (self, KTcpSocket.SslVersion version)
 setCaCertificates (self, [QSslCertificate] certificates)
 setCiphers (self, [KSslCipher] ciphers)
 setLocalCertificate (self, QSslCertificate certificate)
 setLocalCertificate (self, QString fileName, QSsl.EncodingFormat format=QSsl.Pem)
 setPrivateKey (self, KSslKey key)
 setPrivateKey (self, QString fileName, KSslKey.Algorithm algorithm=KSslKey.Rsa, QSsl.EncodingFormat format=QSsl.Pem, QByteArray passPhrase=QByteArray())
 setProxy (self, QNetworkProxy proxy)
 setReadBufferSize (self, long size)
[KSslError] sslErrors (self)
 sslErrors (self, [KSslError] errors)
 startClientEncryption (self)
KTcpSocket.State state (self)
 stateChanged (self, KTcpSocket.State a0)
bool waitForBytesWritten (self, int msecs)
bool waitForConnected (self, int msecs=30000)
bool waitForDisconnected (self, int msecs=30000)
bool waitForEncrypted (self, int msecs=30000)
bool waitForReadyRead (self, int msecs=30000)
long writeData (self, QString data, long maxSize)

Method Documentation

__init__ (  self,
QObject  parent=0
)

Use the proxy set by setProxy(), if any; otherwise use no proxy.

abort (   self )
aboutToClose (   self )
Signal syntax:
QObject.connect(source, SIGNAL("aboutToClose()"), target_slot)
addCaCertificate (  self,
QSslCertificate  certificate
)
addCaCertificates (  self,
[QSslCertificate]  certificates
)
KTcpSocket.SslVersion advertisedSslVersion (   self )
bool atEnd (   self )
long bytesAvailable (   self )
long bytesToWrite (   self )
bytesWritten (  self,
long  bytes
)
Signal syntax:
QObject.connect(source, SIGNAL("bytesWritten(qint64)"), target_slot)
[QSslCertificate] caCertificates (   self )
bool canReadLine (   self )
[KSslCipher] ciphers (   self )
close (   self )
connectToHost (  self,
QString  hostName,
int  port,
KTcpSocket.ProxyPolicy  policy=KTcpSocket.AutoProxy
)
connectToHost (  self,
QHostAddress  hostAddress,
int  port,
KTcpSocket.ProxyPolicy  policy=KTcpSocket.AutoProxy
)
connectToHost (  self,
KUrl  url,
KTcpSocket.ProxyPolicy  policy=KTcpSocket.AutoProxy
)

Take the hostname and port from url and connect to them. The information from a full URL enables the most accurate choice of proxy in case of proxy rules that depend on high-level information like protocol or username.

See also:
KProtocolManager.proxyForUrl()

connectToHostEncrypted (  self,
QString  hostName,
int  port,
QIODevice.OpenMode  openMode=QIODevice.ReadWrite
)
connected (   self )
Signal syntax:
QObject.connect(source, SIGNAL("connected()"), target_slot)
disconnectFromHost (   self )
disconnected (   self )
Signal syntax:
QObject.connect(source, SIGNAL("disconnected()"), target_slot)
encrypted (   self )
Signal syntax:
QObject.connect(source, SIGNAL("encrypted()"), target_slot)
KTcpSocket.EncryptionMode encryptionMode (   self )
encryptionModeChanged (  self,
KTcpSocket.EncryptionMode  a0
)
Signal syntax:
QObject.connect(source, SIGNAL("encryptionModeChanged(EncryptionMode)"), target_slot)
KTcpSocket.Error error (   self )
error (  self,
KTcpSocket.Error  a0
)
Signal syntax:
QObject.connect(source, SIGNAL("error(Error)"), target_slot)
bool flush (   self )
hostFound (   self )
Signal syntax:
QObject.connect(source, SIGNAL("hostFound()"), target_slot)
ignoreSslErrors (   self )
bool isSequential (   self )
bool isValid (   self )
QHostAddress localAddress (   self )
QSslCertificate localCertificate (   self )
KTcpSocket.SslVersion negotiatedSslVersion (   self )
QString negotiatedSslVersionName (   self )
bool open (  self,
QIODevice.OpenMode  open
)
QHostAddress peerAddress (   self )
[QSslCertificate] peerCertificateChain (   self )
QString peerName (   self )
int peerPort (   self )
KSslKey privateKey (   self )
QNetworkProxy proxy (   self )

@see: connectToHost()

proxyAuthenticationRequired (  self,
QNetworkProxy  proxy,
QAuthenticator  authenticator
)
Signal syntax:
QObject.connect(source, SIGNAL("proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)"), target_slot)
long readBufferSize (   self )
long readData (  self,
QString  data,
long  maxSize
)
readyRead (   self )
Signal syntax:
QObject.connect(source, SIGNAL("readyRead()"), target_slot)
KSslCipher sessionCipher (   self )
setAdvertisedSslVersion (  self,
KTcpSocket.SslVersion  version
)
setCaCertificates (  self,
[QSslCertificate]  certificates
)
setCiphers (  self,
[KSslCipher]  ciphers
)
setLocalCertificate (  self,
QSslCertificate  certificate
)
setLocalCertificate (  self,
QString  fileName,
QSsl.EncodingFormat  format=QSsl.Pem
)
setPrivateKey (  self,
KSslKey  key
)
setPrivateKey (  self,
QString  fileName,
KSslKey.Algorithm  algorithm=KSslKey.Rsa,
QSsl.EncodingFormat  format=QSsl.Pem,
QByteArray  passPhrase=QByteArray()
)
setProxy (  self,
QNetworkProxy  proxy
)

@see: connectToHost()

setReadBufferSize (  self,
long  size
)
[KSslError] sslErrors (   self )
sslErrors (  self,
[KSslError]  errors
)
Signal syntax:
QObject.connect(source, SIGNAL("sslErrors(const QList&)"), target_slot)
startClientEncryption (   self )
KTcpSocket.State state (   self )
stateChanged (  self,
KTcpSocket.State  a0
)
Signal syntax:
QObject.connect(source, SIGNAL("stateChanged(State)"), target_slot)
bool waitForBytesWritten (  self,
int  msecs
)
bool waitForConnected (  self,
int  msecs=30000
)
bool waitForDisconnected (  self,
int  msecs=30000
)
bool waitForEncrypted (  self,
int  msecs=30000
)
bool waitForReadyRead (  self,
int  msecs=30000
)
long writeData (  self,
QString  data,
long  maxSize
)

Enumeration Documentation

EncryptionMode
Enumerator:
UnencryptedMode = 0
SslClientMode 
SslServerMode 

Error
Enumerator:
UnknownError = 0
ConnectionRefusedError 
RemoteHostClosedError 
HostNotFoundError 
SocketAccessError 
SocketResourceError 
SocketTimeoutError 
NetworkError 
UnsupportedSocketOperationError 

ProxyPolicy

Use the proxy that KProtocolManager suggests for the connection parameters given.

Enumerator:
AutoProxy = 0
ManualProxy 

SslVersion
Note:
It is necessary to wrap members of this enumeration in a SslVersions instance when passing them to a method as group of flags. For example: SslVersions( UnknownSslVersion | SslV2)
Enumerator:
UnknownSslVersion = 0x01
SslV2 = 0x02
SslV3 = 0x04
TlsV1 = 0x08
SslV3_1 = 0x08
AnySslVersion = SslV2|SslV3|TlsV1

State
Enumerator:
UnconnectedState = 0
HostLookupState 
ConnectingState 
ConnectedState 
BoundState 
ListeningState 
ClosingState 

  • Full Index

Modules

  • akonadi
  • dnssd
  • kdecore
  • kdeui
  • khtml
  • kio
  • knewstuff
  • kparts
  • kutils
  • nepomuk
  • phonon
  • plasma
  • polkitqt
  • solid
  • soprano
This documentation is maintained by Simon Edwards.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal