Qt logo

QSocketAddress Class Reference


QSocketAddress provides a port number and an IP address. More...

#include <qsocketdevice.h>

List of all member functions.

Public Members

Protected Members


Detailed Description

QSocketAddress provides a port number and an IP address.

This class contains a port number and an IP address in a platform-independent manner. QSocketAddress is normally used with the classes QSocketDevice and QSocket to set up a server or to connect to a host.

See also: QSocket and QSocketDevice.


Member Function Documentation

QSocketAddress::QSocketAddress ()

Creates a socket address object with the port number 0 and IP address 0.0.0.0.

QSocketAddress::QSocketAddress ( const QSocketAddress & a )

Creates a copy of another socket address.

QSocketAddress::QSocketAddress ( int port, uint ip4Addr=0 )

Creates a socket address object with a specified port number and IP address.

QSocketAddress::~QSocketAddress ()

Destroys the socket address object.

uint QSocketAddress::ip4Addr () const

Returns the IP address as a number.

For example, if the address is 127.0.0.1, the returned value is 2130706433 (hex: 7f000001).

See also: ip4AddrString().

QString QSocketAddress::ip4AddrString () const

Returns the IP address as a string.

For example, if the address is 2130706433 (hex: 7f000001), the returned string is "127.0.0.1".

See also: ip4Addr().

QSocketAddress & QSocketAddress::operator= ( const QSocketAddress & a )

Assigns another socket address object a to this object and returns a referense to this object.

bool QSocketAddress::operator== ( const QSocketAddress & a )

Returns TRUE if this socket address is identical to a, or FALSE if they are different.

int QSocketAddress::port () const

Returns the port number.


Search the documentation, FAQ, qt-interest archive and more (uses www.troll.no):


This file is part of the Qt toolkit, copyright © 1995-99 Troll Tech, all rights reserved.


Copyright İ 1999 Troll TechTrademarks
Qt version 2.0.2