How
ScriptEZ.API wraps and unwraps data/messages for your sake ?
(1) Typology
for TCP/IP server in methods/properties calling: see an example
1.
Initialisation: |
Call to CreatePoolSocketServerObject(…) to
instantiate a server and to wait for incoming connections (listening) |
2. Incoming
Connection (notification): |
onConnectionRequest(…) is called when
an incoming connection occurs. At this point, the server can optionally call
to AddSocketClientObjectEventHandlers(…)
or can return 1, to accept the client request and delegate the
conversation between a socket client proxy object and the remote client. |
3.
Conversation (...): |
onData(…) is called for each
handle of socket proxy object per client to deal with received messages and
responses, by calling to SendSocketObjectData(…) or SendSocketObjectBinaryData(…)
|
4. End
of conversation: |
onConnectionState(…) is called for each handle of socket proxy
object per client with a description of a socket proxy object status ( closed
or broken ), plus an error number: |
5. End
of the server: |
The server object is destroyed when ScriptEZ.API
object is released or when the application exits. |
. Thread pooled Server . Remote
Client(s)
(2) Typology
for TCP/IP client in methods/properties calling: see an example
1. Initialisation : |
Call to CreateSocketClientObjectEx(…)
to instantiate a client object. |
2.
Outcoming Connection: |
Call to ConnectSocketServerObject(…)
to initiate a connection with a
server. If a first connection to a server happened
well, but in the meantime the network is broken or
the server is gone, the ScriptEZ.API
component provides an auto-reconnection feature from within
the client side without any extra work. |
3. Accepted or Denied Connection
(notification): |
onConnectionState(…) is called and provides a
handle of socket client object (hOwnerSocket), with a description ( connected, closed or
broken ), plus an error number: |
4.
Conversation (...) : |
if a connection is
established, calls to SendSocketObjectData(…) or SendSocketObjectBinaryData(…)
will send data or messages to the server... |
5. End
of conversation : |
The conversation is terminated when ScriptEZ.API
object is released, the application exits or the server is gone. |