PIPXSocket Class Reference

#include <ipxsock.h>

Inheritance diagram for PIPXSocket:

PSocket PChannel PObject PSPXSocket List of all members.

Address and name space look up functions

PBoolean GetLocalAddress (Address &addr)
PBoolean GetLocalAddress (Address &addr, WORD &port)
PBoolean GetPeerAddress (Address &addr)
PBoolean GetPeerAddress (Address &addr, WORD &port)
static PString GetHostName (const Address &addr)
static PBoolean GetHostAddress (Address &addr)
static PBoolean GetHostAddress (const PString &hostname, Address &addr)

Public Member Functions

 PIPXSocket (WORD port=0)
Overrides from class PChannel
virtual PString GetName () const
Overrides from class PSocket
virtual PBoolean Connect (const PString &address)
virtual PBoolean Connect (const Address &address)
virtual PBoolean Listen (unsigned queueSize=5, WORD port=0, Reusability reuse=AddressIsExclusive)
I/O functions
PBoolean SetPacketType (int type)
int GetPacketType ()
virtual PBoolean ReadFrom (void *buf, PINDEX len, Address &addr, WORD &port)
virtual PBoolean WriteTo (const void *buf, PINDEX len, const Address &addr, WORD port)

Protected Member Functions

virtual PBoolean OpenSocket ()
virtual const char * GetProtocolName () const

Classes

class  Address

Detailed Description

This class describes a type of socket that will communicate using the IPX/SPX protocols.


Constructor & Destructor Documentation

PIPXSocket::PIPXSocket ( WORD  port = 0  ) 

Create a new IPX datagram socket.

Parameters:
port  Port number to use for the connection.


Member Function Documentation

virtual PString PIPXSocket::GetName (  )  const [virtual]

Get the platform and I/O channel type name of the channel. For an IPX/SPX socket this returns the network number, node number of the peer the socket is connected to, followed by the socket number it is connected to.

Returns:
the name of the channel.

Reimplemented from PChannel.

virtual PBoolean PIPXSocket::Connect ( const PString address  )  [virtual]

Connect a socket to a remote host on the port number of the socket. This is typically used by the client or initiator of a communications channel. This connects to a "listening" socket at the other end of the communications channel.

The port number as defined by the object instance construction or the PIPSocket::SetPort()# function.

Returns:
PTrue if the channel was successfully connected to the remote host.
Parameters:
address  Address of remote machine to connect to.

Reimplemented from PSocket.

virtual PBoolean PIPXSocket::Connect ( const Address address  )  [virtual]

Connect a socket to a remote host on the port number of the socket. This is typically used by the client or initiator of a communications channel. This connects to a "listening" socket at the other end of the communications channel.

The port number as defined by the object instance construction or the PIPSocket::SetPort()# function.

Returns:
PTrue if the channel was successfully connected to the remote host.
Parameters:
address  Address of remote machine to connect to.

virtual PBoolean PIPXSocket::Listen ( unsigned  queueSize = 5,
WORD  port = 0,
Reusability  reuse = AddressIsExclusive 
) [virtual]

Listen on a socket for a remote host on the specified port number. This may be used for server based applications. A "connecting" socket begins a connection by initiating a connection to this socket. An active socket of this type is then used to generate other "accepting" sockets which establish a two way communications channel with the "connecting" socket.

If the port# parameter is zero then the port number as defined by the object instance construction or the PIPSocket::SetPort()# function.

For the UDP protocol, the queueSize# parameter is ignored.

Returns:
PTrue if the channel was successfully opened.
Parameters:
queueSize  Number of pending accepts that may be queued.
port  Port number to use for the connection.
reuse  Can/Cant listen more than once.

Reimplemented from PSocket.

Reimplemented in PSPXSocket.

static PString PIPXSocket::GetHostName ( const Address addr  )  [static]

Get the host name for the host specified server.

Returns:
Name of the host or IPX number of host.
Parameters:
addr  Hosts IP address to get name for

static PBoolean PIPXSocket::GetHostAddress ( Address addr  )  [static]

Get the IPX address for the specified host.

Returns:
PTrue if the IPX number was returned.
Parameters:
addr  Variable to receive this hosts IP address

static PBoolean PIPXSocket::GetHostAddress ( const PString hostname,
Address addr 
) [static]

Get the IPX address for the specified host.

Returns:
PTrue if the IPX number was returned.
Parameters:
addr  Name of host to get address for. This may be either a server name or an IPX number in "colon" format. Variable to receive hosts IPX address

PBoolean PIPXSocket::GetLocalAddress ( Address addr  ) 

Get the IPX/SPX address for the local host.

Returns:
PTrue if the IPX number was returned.
Parameters:
addr  Variable to receive hosts IPX address

PBoolean PIPXSocket::GetLocalAddress ( Address addr,
WORD &  port 
)

Get the IPX/SPX address for the local host.

Returns:
PTrue if the IPX number was returned.
Parameters:
addr  Variable to receive peer hosts IPX address
port  Variable to receive peer hosts port number

PBoolean PIPXSocket::GetPeerAddress ( Address addr  ) 

Get the IPX/SPX address for the peer host the socket is connected to.

Returns:
PTrue if the IPX number was returned.
Parameters:
addr  Variable to receive hosts IPX address

PBoolean PIPXSocket::GetPeerAddress ( Address addr,
WORD &  port 
)

Get the IPX/SPX address for the peer host the socket is connected to.

Returns:
PTrue if the IPX number was returned.
Parameters:
addr  Variable to receive peer hosts IPX address
port  Variable to receive peer hosts port number

PBoolean PIPXSocket::SetPacketType ( int  type  ) 

Sets the packet type for datagrams sent by this socket.

Returns:
PTrue if the type was successfully set.
Parameters:
type  IPX packet type for this socket.

int PIPXSocket::GetPacketType (  ) 

Gets the packet type for datagrams sent by this socket.

Returns:
type of packets or -1 if error.

virtual PBoolean PIPXSocket::ReadFrom ( void *  buf,
PINDEX  len,
Address addr,
WORD &  port 
) [virtual]

Read a datagram from a remote computer.

Returns:
PTrue if all the bytes were sucessfully written.
Parameters:
buf  Data to be written as URGENT TCP data.
len  Number of bytes pointed to by buf#.
addr  Address from which the datagram was received.
port  Port from which the datagram was received.

virtual PBoolean PIPXSocket::WriteTo ( const void *  buf,
PINDEX  len,
const Address addr,
WORD  port 
) [virtual]

Write a datagram to a remote computer.

Returns:
PTrue if all the bytes were sucessfully written.
Parameters:
buf  Data to be written as URGENT TCP data.
len  Number of bytes pointed to by buf#.
addr  Address to which the datagram is sent.
port  Port to which the datagram is sent.

virtual PBoolean PIPXSocket::OpenSocket (  )  [protected, virtual]

Implements PSocket.

Reimplemented in PSPXSocket.

virtual const char* PIPXSocket::GetProtocolName (  )  const [protected, virtual]

This function returns the protocol name for the socket type.

Implements PSocket.

Reimplemented in PSPXSocket.


The documentation for this class was generated from the following file:
Generated on Mon Feb 23 01:57:57 2009 for PTLib by  doxygen 1.5.1