*              How ScriptEZ.API wraps and unwraps data/messages for your sake ?

 

 

(1) Typology for Named Pipe server in methods/properties calling: see an example

1. Initialisation :

Call to CreatePoolNamedPipeServerObject(…) to instantiate a server and to wait for incoming connections (listening)

 

2. Incoming Connection

  (notification):

onConnectionRequestNamedPipe(…) is called when an incoming connection occurs. At this point, the server can optionally call to AddNamedPipeClientObjectEventHandlers(…) or can return 1, to accept the client request and delegate the conversation between a NamedPipe client proxy object and the remote client.
 
(!)  In the contrary, the server can deny a connection by returning 0.

 

3. Conversation (...) :

onDataNamedPipe (…) is called for each handle of  NamedPipe proxy object per client to deal with messages and responses, by calling to SendNamedPipeObjectData(…) or SendNamedPipeObjectBinaryData(…)
 
During this step, the server remains parallely ready to accept or refuse a new incoming connection !

 

4. End of conversation:

onConnectionStateNamedPipe (…)  is called for each handle of  NamedPipe proxy object per client with a description of a NamedPipe proxy object status ( closed or broken ), plus an error number:
 
   . 'error_number = 0  ' means the connection is closed gracefully.
   . 'error_number = <other values>' means the connection is broken.

 

5. End of the server :

The server object is destroyed when ScriptEZ.API object is released or when the application exits.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

client-server

. Thread pooled Server                      . Remote Client(s)

 

(2) Typology for Named Pipe client in methods/properties calling: see an example

1. Initialisation :

Call to CreateNamedPipeClientObjectEx(…) to instantiate a client object

 

2. Outcoming Connection:

Call to ConnectNamedPipeServerObject(…) to  initiate a connection with a server.

 

3. Accepted or Denied Connection (notification):

onConnectionStateNamedPipe (…) is called and provides  a handle of NamedPipe client object (hOwnerNamedPipe), with a description ( connected, refused or broken ), plus an error number:
 
  . 'error_number = 0      '  means the connection is established.
  . 'error_number = <other values>' means the connection is broken or refused.

 

4. Conversation (...):

if a connection is established, calls to  SendNamedPipeObjectData(…) or SendNamedPipeObjectBinaryData(…) will send data or messages to the server...
                                  
onDataNamedPipe(…) is called if responses from the server occur and are received, and this should be dealt with and so on.

 

5. End of conversation:

The conversation is terminated when ScriptEZ.API object is released, the application exits or the server is gone.