SDK Home Glossary Index Left Right Up

Socket Server


Section contents


Overview

The socket service routines are based on the methods provided by the C++ RSocketServ class.

Defined in

csocket.oxh

Description

The SocketServ class provides the SocketServConnect function to create an IPC communication channel to the socket server. The prime use for instances of SocketServ is to establish subsession communications for Socket, HostResolver and NetDatabase.


Construction / destruction


NewSocketServer

Usage

this& = NewSocketServer&:

Description

Create a socket server object and returns a handle to the created object.

Return Value
this& A handle which represents the created socket server object
Error Handling

If the object could not be created then an error is generated which should be trapped by an ONERR handler.


DeleteSocketServer

Usage

DeleteSocketServer:(BYREF this&)

Description

Destroys the socket server object.

Arguments
BYREF this& A handle for a socket server object. A zero value is written back into the variable

Services provided


SocketServClearExclusiveMode

Usage

SocketServClearExclusiveMode:(this&)

Description

<TBS>

Arguments
this& A handle for a socket server object

SocketServClose

Usage

SocketServClose:(this&)

Description

Close() should be called once the session is no longer required.

All resources which are opened using the session will be automatically closed when the session terminates. When the last session which has open resources for a protocol is closed a protocol module will be unloaded automatically by the socket server.

Arguments
this& A handle for a socket server object

SocketServConnect

Usage

err% = SocketServConnect%:(this&,msgSlots&)

Description

Use this function to open a session to the socket server.

Arguments
this& A handle for a socket server object
msgSlots& The number of message slots. If you wish to use the default number of message slots the pass KSockDefaultMessageSlots&
Return Value
err% An error code
Notes

The number of message slots indicates how many operations are allowed to be uncompleted at any one time by the combined resources opened on the session. All synchronous operations consume one message slot and an asynchronous operation consumes one message slot while it is not complete. For instance, an Socket which is performing asynchronous reads and writes requires two slots for them and one more slot for synchronous operations making three in total. If another Socket, which performs concurrent asynchronous reads and writes, is added then the total is five slots. The result of having too few slots is not fatal. However, operations may return KE32ErrServerBusy& indicating that no message slot was available after a small time trying.


SocketServFindProtocol

Usage

err% = SocketServFindProtocol%:(this&,name$,buffer&)

Description

Use this function to lookup the description of a protocol by name.

Arguments
this& A handle for a socket server object
name$ The name of the protocol to find
buffer& A handle for a protocol description object
Return Value
err% An error code

SocketServGetProtocolInfo

Usage

err% = SocketServGetProtocolInfo%:(this&,index%,buffer&)

Description

Use this function to get information about all protocols

Arguments
this& A handle for a socket server object
index% The index of the protocol. The index must be between 1 and the number of supported protocols.
buffer& A handle for a protocol description object
Return Value
err% An error code

SocketServInstallExtension

Usage

err% = SocketServInstallExtension%:(this&,dllname$,args$)

Description

<TBS>

Arguments
this& A handle for a socket server object
dllname$ The name of the extension DLL
args$ The arguments to be passed to the extension DLL
Return Value
err% An error code

SocketServNumProtocols

Usage

err% = SocketServNumProtocols%:(this&,BYREF&nbsplcount%)

Description

Use this function to get the number of protocols the socket server currently is aware of.

Arguments
this& A handle for a socket server object
BYREF count% The number of protocols
Return Value
err% An error code

SocketServSetExclusiveModeA

Usage

SocketServSetExclusiveModeA:(this&,BYREF&nbsplstatus&)

Description

<TBS>

Arguments
this& A handle for a socket server object
BYREF status& The status of the asynchronous operation
Error Handling

If the status& object cannot be created then an error is generated which should be trapped by an ONERR handler.


SocketServStartProtocolA

Usage

SocketServStartProtocolA:(this&,family%,socketType%,protocol%,BYREF status&)

Description

Use this function to load a protocol specified by family, socket type and protocol identifier.

Arguments
this& A handle for a socket server object
family& Specifies the address family
socketType& Specifies the socket type
protocol& Specifies the protocols
BYREF status& status of the asynchronous operation
Error Handling

If the status& object cannot be created then an error is generated which should be trapped by an ONERR handler.

Notes

There is no way to cancel this operation once it has been called. On completion the status word is signalled with the result of loading a protocol.


SocketServStopProtocolA

Usage

SocketServStopProtocolA:(this&,family%,socketType%,protocol%,BYREF status&)

Description

<TBS>

Arguments
this& A handle for a socket server object
family& Specifies the address family
socketType& Specifies the socket type
protocol& Specifies the protocols
BYREF status& status of the asynchronous operation
Error Handling

If the status& object cannot be created then an error is generated which should be trapped by an ONERR handler.


SocketServVersion

Usage

SocketServVersion&:(this&)

Description

Use this function to get the version of this client.

Arguments
this& A handle for a socket server object
Return value
version& A handle to a newly created version object. This handle must be freed when it is no longer required
Error Handling

If the version& object cannot be created then an error is generated which should be trapped by an ONERR handler.


  SDK Home Glossary Index Left Right Up