![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Section contents
The socket service routines are based on the methods provided by the C++ RSocketServ class.
csocket.oxh
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.
this& = NewSocketServer&:
Create a socket server object and returns a handle to the created object.
this& |
A handle which represents the created socket server object |
If the object could not be created then an error is generated
which should be trapped by an ONERR
handler.
DeleteSocketServer:(BYREF this&)
Destroys the socket server object.
BYREF this& |
A handle for a socket server object. A zero value is written back into the variable |
SocketServClearExclusiveMode:(this&)
<TBS>
this& |
A handle for a socket server object |
SocketServClose:(this&)
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.
this& |
A handle for a socket server object |
err% = SocketServConnect%:(this&,msgSlots&)
Use this function to open a session to the socket server.
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& |
err% |
An error code |
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.
err% =
SocketServFindProtocol%:(this&,name$,buffer&)
Use this function to lookup the description of a protocol by name.
this& |
A handle for a socket server object |
name$ |
The name of the protocol to find |
buffer& |
A handle for a protocol description object |
err% |
An error code |
err% =
SocketServGetProtocolInfo%:(this&,index%,buffer&)
Use this function to get information about all protocols
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 |
err% |
An error code |
err% =
SocketServInstallExtension%:(this&,dllname$,args$)
<TBS>
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 |
err% |
An error code |
err% =
SocketServNumProtocols%:(this&,BYREF lcount%)
Use this function to get the number of protocols the socket server currently is aware of.
this& |
A handle for a socket server object |
BYREF count% |
The number of protocols |
err% |
An error code |
SocketServSetExclusiveModeA:(this&,BYREF lstatus&)
<TBS>
this& |
A handle for a socket server object |
BYREF status& |
The status of the asynchronous operation |
If the status&
object cannot be created then
an error is generated which should be trapped by an ONERR
handler.
SocketServStartProtocolA:(this&,family%,socketType%,protocol%,BYREF status&)
Use this function to load a protocol specified by family, socket type and protocol identifier.
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 |
If the status&
object cannot be created then
an error is generated which should be trapped by an ONERR
handler.
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:(this&,family%,socketType%,protocol%,BYREF status&)
<TBS>
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 |
If the status&
object cannot be created then
an error is generated which should be trapped by an ONERR
handler.
SocketServVersion&:(this&)
Use this function to get the version of this client.
this& |
A handle for a socket server object |
version& |
A handle to a newly created version object. This handle must be freed when it is no longer required |
If the version&
object cannot be created then
an error is generated which should be trapped by an ONERR
handler.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |