QSDK 1.1 Documentation
Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

Net::Socket Struct Reference
[QNet]

#include <Q/net.h>

Inheritance diagram for Net::Socket:

Com::Unknown List of all members.

Public Types

typedef Com::Ptr< SocketPTR

Public Member Functions

virtual void getRemoteAddress (Address **addrP) const=0
virtual void getLocalAddress (Address **addrP) const=0
virtual void setRemoteAddress (Address *addr)=0
virtual void setAddresses (Address *localAddress, Address *remoteAddress)=0
virtual void setLocalAddress (Address *addr)=0
virtual bool valid () const=0
virtual void reuseAddress (bool reuse)=0
virtual void connect ()=0
virtual void bind ()=0
virtual Utils::Result accept (Socket **sockP)=0
virtual void close ()=0

Static Public Attributes

Com::UUID IID
Com::UUID CLSID

Detailed Description

A Socket represents a connection between two endpoints on the network, one local and one remote. The socket also implements both ReadStream and WriteStream interface for communicating with the remote endpoint.


Member Function Documentation

virtual Utils::Result Net::Socket::accept Socket **  sockP  )  [pure virtual]
 

For server sockets which have clients connecting to them, accept the next connection from the queue and create a new Socket to represent it. When the caller is finished with the client socket it should call Unknown::release() to free it.

virtual void Net::Socket::bind  )  [pure virtual]
 

Bind the socket to the previously specified local address.

virtual void Net::Socket::close  )  [pure virtual]
 

Close the network connection represented by this socket.

virtual void Net::Socket::connect  )  [pure virtual]
 

Connect the socket to the previously specified remote address.

virtual void Net::Socket::getLocalAddress Address **  addrP  )  const [pure virtual]
 

Get the local address associated with the socket. The address returned will have had its reference count increased by one - the caller should call Unknown::release() when it is finished with the address.

virtual void Net::Socket::getRemoteAddress Address **  addrP  )  const [pure virtual]
 

Get the remote address associated with the socket. The address returned will have had its reference count increased by one - the caller should call Unknown::release() when it is finished with the address.

virtual void Net::Socket::reuseAddress bool  reuse  )  [pure virtual]
 

Call reuseAddress(true) if the socket is to allow local port reuse (i.e. multiple sockets sharing the same local port). This is normally used on server sockets which can be connected to.

virtual void Net::Socket::setAddresses Address localAddress,
Address remoteAddress
[pure virtual]
 

Set both the local and remote addresses for the socket.

virtual void Net::Socket::setLocalAddress Address addr  )  [pure virtual]
 

Set the remote address for the socket. The socket will take an extra reference to the address using Unknown::addRef().

virtual void Net::Socket::setRemoteAddress Address addr  )  [pure virtual]
 

Set the remote address for the socket. The socket will take an extra reference to the address using Unknown::addRef().

virtual bool Net::Socket::valid  )  const [pure virtual]
 

Return true if the socket is still valid.


Member Data Documentation

Com::UUID Net::Socket::CLSID [static]
 

COM CLSID 6952ecd2-90fb-4cdc-b897-440c42cd7d00

Com::UUID Net::Socket::IID [static]
 

COM IID 32fc7790-2f0a-48d9-aea0-74f5678bd6a4

Reimplemented from Com::Unknown.

Return to QSDK documentation Contents page. Contact details for support, information and fault-reporting.
Qube Software Limited © 2000-2004