class PIPXSocket: public PSocket

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

Inheritance:


Public Classes

[more]class Address
IPX protocol address specification

Public Methods

[more] PIPXSocket ( WORD port = 0 )
Create a new IPX datagram socket.

Public

[more] Overrides from class PChannel
[more] Overrides from class PSocket
[more] Address and name space look up functions
[more] I/O functions


Inherited from PSocket:

Public

Socket establishment functions

Socket options functions

Port/Service database functions

Multiple socket selection functions

Integer conversion functions

Protected Fields

oWORD port

Protected Methods

ovirtual const char* GetProtocolName() const


Inherited from PChannel:

Public Methods

ostatic BOOL ConvertOSError( int libcReturnValue, Errors & lastError, int & osError )

Public

Construction

Overrides from class PObject

Information functions

Reading functions

Writing functions

Miscellaneous functions

Error functions

Protected Fields

oint os_handle
oErrors lastErrorCode[NumErrorGroups+1]
oint lastErrorNumber[NumErrorGroups+1]
oPINDEX lastReadCount
oPINDEX lastWriteCount
oPTimeInterval readTimeout
oPTimeInterval writeTimeout

Protected Methods

ovirtual BOOL ConvertOSError( int libcReturnValue, ErrorGroup group = LastGeneralError )
oBOOL SetErrorValues( Errors errorCode, int osError, ErrorGroup group = LastGeneralError )
oint ReadCharWithTimeout( PTimeInterval & timeout )


Inherited from PObject:

Public

Run Time Type functions

Comparison functions


Documentation

This class describes a type of socket that will communicate using the IPX/SPX protocols
o PIPXSocket( WORD port = 0 )
Create a new IPX datagram socket.
Parameters:
port - Port number to use for the connection.

o Overrides from class PChannel

ovirtual PString GetName() const
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.

o Overrides from class PSocket

ovirtual BOOL Connect( const PString & address )
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:
TRUE if the channel was successfully connected to the remote host.
Parameters:
address - Address of remote machine to connect to.

ovirtual BOOL Connect( const Address & address )
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:
TRUE if the channel was successfully connected to the remote host.
Parameters:
address - Address of remote machine to connect to.

ovirtual BOOL Listen( unsigned queueSize = 5, WORD port = 0, Reusability reuse = AddressIsExclusive )
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 äccepting" 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:
TRUE 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.

o Address and name space look up functions

ostatic PString GetHostName( const Address & addr )
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

ostatic BOOL GetHostAddress( Address & addr )
Get the IPX address for the specified host.

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

ostatic BOOL GetHostAddress( const PString & hostname, Address & addr )
Get the IPX address for the specified host.

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

oBOOL GetLocalAddress( Address & addr )
Get the IPX/SPX address for the local host.

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

oBOOL GetLocalAddress( Address & addr, WORD & port )
Get the IPX/SPX address for the local host.

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

oBOOL GetPeerAddress( Address & addr )
Get the IPX/SPX address for the peer host the socket is connected to.

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

oBOOL GetPeerAddress( Address & addr, WORD & port )
Get the IPX/SPX address for the peer host the socket is connected to.

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

o I/O functions

oBOOL SetPacketType( int type )
Sets the packet type for datagrams sent by this socket.

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

oint GetPacketType()
Gets the packet type for datagrams sent by this socket.

Returns:
type of packets or -1 if error.

ovirtual BOOL ReadFrom( void * buf, PINDEX len, Address & addr, WORD & port )
Read a datagram from a remote computer.

Returns:
TRUE 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.

ovirtual BOOL WriteTo( const void * buf, PINDEX len, const Address & addr, WORD port )
Write a datagram to a remote computer.

Returns:
TRUE 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.


Direct child classes:
PSPXSocket

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.