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

Net2::Socket Struct Reference
[QNet]

#include <Q/net.h>

Inheritance diagram for Net2::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 Utils::Result connect ()=0
virtual Utils::Result bind ()=0
virtual Utils::Result accept (Socket **sockP)=0
virtual void close ()=0

Static Public Attributes

Com::UUID IID

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 Net2::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 Utils::Result Net2::Socket::bind  )  [pure virtual]
 

Bind the socket to the previously specified local address.

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

Close the network connection represented by this socket.

virtual Utils::Result Net2::Socket::connect  )  [pure virtual]
 

Connect the socket to the previously specified remote address.

virtual void Net2::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 Net2::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 Net2::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 Net2::Socket::setAddresses Address localAddress,
Address remoteAddress
[pure virtual]
 

Set both the local and remote addresses for the socket.

virtual void Net2::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 Net2::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 Net2::Socket::valid  )  const [pure virtual]
 

Return true if the socket is still valid.


Member Data Documentation

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

COM IID 36640680-e484-44d1-9295-814f847de8c5

Reimplemented from Com::Unknown.

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