Service
|
Details
|
Client encoding |
Set the client's receive and send data encoding types.
By default, when a client connects it uses UTF8 encoding for both receive and send.
This service can be used to change the data transfer methods used by the
Get server data and
Send to server services.
|
Argument |
Description |
Input |
1 |
Receive encoding |
The encoding to use for receiving data from the connected server.
|
2 |
Send encoding |
The encoding to use for sending data to the connected server.
|
Output |
0 |
Succeeded |
Operation succeeded: TRUE or FALSE |
Close |
Close socket. This closes either a client-side end point of the socket or a server-side end
point of the socket.
When a client end point disconnects, a custom event called "SocketEvent" is generated
with the "DisconnectedByClient" supplied in the "Aux Data 1" output data port of the
Windows Event or Windows Event Callback components.
Data port 2 will contain the client socket index
that identifies which client connection has closed.
When a server end point disconnects a custom event called "SocketEvent" is generated
with the "DisconnectedByServer" supplied in the "Aux Data 1" output data port of the
Windows Event or Windows Event Callback components.
|
Argument |
Description |
Output |
0 |
Succeeded |
Operation succeeded: TRUE or FALSE |
Connect client |
Connect client to socket server. This attempts to create a client-side end point and
connect to a server end point via IP address.
When a client end point attempts to connect, the server end point will receive
a custom event called "SocketEvent"
with "Connecting" supplied in the "Aux Data 1" output data port of the
Windows Event or Windows Event Callback components
if the server has auto connections
enabled. In this case, if the server decides to accept the client's connection request
then the
Enable client cnx
service should be called.
If the server has auto connections enabled
then the client connection will be established automatically and a "SocketEvent"
custom event with "Connected" supplied in the "Aux Data 1" output data port of the
Windows Event or Windows Event Callback components will instead be generated.
For both "Connecting" and "Connected" events, data port 2 will contain the client socket index
which can be used as input to other server services to control and manage client connections.
|
Argument |
Description |
Input |
0 |
IP address |
IP address of server |
1 |
Port |
Socket port |
Output |
0 |
Succeeded |
Operation succeeded: TRUE or FALSE |
Enable client cnx |
Enable connection from requesting client. Manually enables a connection request
by a client-side end point.
|
Argument |
Description |
Input |
0 |
Socket index |
Client socket index (0 offset) |
Output |
0 |
Succeeded |
Operation succeeded: TRUE or FALSE |
Get client IP |
Get IP address of connected client. This allows a server-side end point to verify the IP address
of a client-side end points to optionally grant or disallow connection requests.
|
Argument |
Description |
Input |
0 |
Socket index |
Client socket index (0 offset) |
Output |
0 |
IP address |
IP address of connected client |
Get client data |
Get data sent from client. This service is used by a server-side end point to retrieve data
sent by a connected client.
When a client end point sends data a custom event called "SocketEvent" is generated
with the "DataFromClient" supplied in the "Aux Data 1" output data port of the
Windows Event or Windows Event Callback components.
This service is usually called upon trapping this event in order to retrieve the
received data.
|
Argument |
Description |
Input |
0 |
Socket index |
Client socket index (0 offset) |
1 |
Consume |
Consume socket data |
Output |
0 |
Data |
Data |
Get server data |
Get data sent from server. This service is used by a client-side end point to retrieve data
sent by a connected server.
When a server end point sends data a custom event called "SocketEvent" is generated
with the "DataFromServer" supplied in the "Aux Data 1" output data port of the
Windows Event or Windows Event Callback components.
This service is usually called upon trapping this event in order to retrieve the
received data.
|
Argument |
Description |
Input |
0 |
Consume |
Consume socket data |
Output |
0 |
Data |
Data |
Num sockets |
Get number of connected client sockets. This service is used by a server to get the number
of currently connected clients.
|
Argument |
Description |
Output |
0 |
Num sockets |
Number of connected clients |
Open server |
Start socket server. This creates a server-side end point that starts listening for
client-side connection attempts.
|
Argument |
Description |
Input |
0 |
Port |
Socket port |
1 |
Max sockets |
Max number of client sockets |
2 |
Max queue |
Max number of queued requests |
Output |
0 |
Succeeded |
Operation succeeded: TRUE or FALSE |
Receive client file |
Begins a file receive from a connected client. This service is used by a server to
wait for and receive a file from a connected client.
The server must call this service prior to the client calling the
Send file to server service.
When the file is received by the server a "SocketEvent"
Windows event is generated server-side
with "FileReceivedFromClient" in the "Aux Data 1" output data port.
If the client disconnects during data transfer, a "SocketEvent" custom event with
"DisconnectedByClient" in the "Aux Data 1" output data port of the
Windows Event or Windows Event Callback components is generated server-side.
|
Argument |
Description |
Input |
0 |
Socket index |
Client socket index (0 offset) |
1 |
File path |
Path to save the received file.
|
2 |
File size |
Indicates the size of the expected file (in bytes). This allows the server to know
when the data transfer for the file is completed and the saved file can be closed.
The client must communicate to the server the size of the file to be transmitted prior
to the initiation of the file transfer process.
|
Output |
0 |
Succeeded |
Operation succeeded: TRUE or FALSE |
Receive server file |
Begins a file receive from the connected server. This service is used by a client to
wait for and receive a file from a connected server.
The client must call this service prior to the server calling the
Send file to client service.
When the file is received by the client a "SocketEvent"
Windows event is generated client-side
with "FileReceivedFromServer" in the "Aux Data 1" output data port.
If the server disconnects during data transfer, a "SocketEvent" custom event with
"DisconnectedByServer" in the "Aux Data 1" output data port of the
Windows Event or Windows Event Callback components is generated client-side.
|
Argument |
Description |
Input |
1 |
File path |
Path to save the received file.
|
2 |
File size |
Indicates the size of the expected file (in bytes). This allows the client to know
when the data transfer for the file is completed and the saved file can be closed.
The server must communicate to the client the size of the file to be transmitted prior
to the initiation of the file transfer process.
|
Output |
0 |
Succeeded |
Operation succeeded: TRUE or FALSE |
Send file to client |
Sends a file to a connected client. This service is used by a server to send a file to
a connected client.
The client must be expecting a file by having invoked the
Receive server file service
prior to the server invoking the "Send file to client" service.
If this is not done then the client will receive data as a string as if the server called
the Send to client service instead.
When the file is received by the client a "SocketEvent"
Windows event is generated client-side
with "FileReceivedFromServer" in the "Aux Data 1" output data port.
If the client disconnects during data transfer, a "SocketEvent" custom event with
"DisconnectedByClient" in the "Aux Data 1" output data port of the
Windows Event or Windows Event Callback components is generated server-side.
|
Argument |
Description |
Input |
0 |
Socket index |
Client socket index (0 offset) |
1 |
File path |
Path to the file to send to the connected client.
|
2 |
Asynchronous |
Indicates whether or not the file should be sent asynchronously or synchronously.
If the file is sent asynchronously then when the file transmission is complete
a "SocketEvent" Windows event is generated
with "FileSentToClient" in the "Aux Data 1" output data port.
|
Output |
0 |
Succeeded |
Operation succeeded: TRUE or FALSE |
Send file to server |
Sends a file to the connected server. This service is used by a client to send a file to
the connected server.
The server must be expecting a file by having invoked the
Receive client file service
prior to the client invoking the "Send file to server" service.
If this is not done then the server will receive data as a string as if the client called
the Send to server service instead.
When the file is received by the server a "SocketEvent"
Windows event is generated server-side
with "FileReceivedFromClient" in the "Aux Data 1" output data port.
If the server disconnects during data transfer, a "SocketEvent" custom event with
"DisconnectedByServer" in the "Aux Data 1" output data port of the
Windows Event or Windows Event Callback components is generated client-side.
|
Argument |
Description |
Input |
1 |
File path |
Path to the file to send to the connected server.
|
2 |
Asynchronous |
Indicates whether or not the file should be sent asynchronously or synchronously.
If the file is sent asynchronously then when the file transmission is complete
a "SocketEvent" Windows event is generated
with "FileSentToServer" in the "Aux Data 1" output data port.
|
Output |
0 |
Succeeded |
Operation succeeded: TRUE or FALSE |
Send to client |
Send data to a connected client. This service is used by a server to send data to
a connected client. When data is received by the client a "SocketEvent"
Windows event is generated client-side
with "DataFromServer" in the "Aux Data 1" output data port.
If the client disconnects during data transfer, a "SocketEvent" custom event with
"DisconnectedByClient" in the "Aux Data 1" output data port of the
Windows Event or Windows Event Callback components is generated server-side.
|
Argument |
Description |
Input |
0 |
Socket index |
Client socket index (0 offset) |
1 |
Data |
Data |
2 |
Asynchronous |
Indicates whether or not data should be sent asynchronously or synchronously.
If data is sent asynchronously then when the data transmission is complete
a "SocketEvent" Windows event is generated
with "DataSentToClient" in the "Aux Data 1" output data port.
|
Output |
0 |
Succeeded |
Operation succeeded: TRUE or FALSE |
Send to server |
Send data to the connected server. This service is used by a client to send data to a server.
When data is received by the server a "SocketEvent"
Windows event is generated server-side
with "DataFromClient" in the "Aux Data 1" output data port.
If the server disconnects during data transfer, a "SocketEvent" custom event with
"DisconnectedByServer" in the "Aux Data 1" output data port of the
Windows Event or Windows Event Callback components is generated client-side.
|
Argument |
Description |
Input |
0 |
Data |
Data |
2 |
Asynchronous |
Indicates whether or not data should be sent asynchronously or synchronously.
If data is sent asynchronously then when the data transmission is complete
a "SocketEvent" Windows event is generated
with "DataSentToServer" in the "Aux Data 1" output data port.
|
Output |
0 |
Succeeded |
Operation succeeded: TRUE or FALSE |
Server encoding |
Set the server's receive and send data encoding types when communicating with a given client.
By default, when a client connects the server uses UTF8 encoding for both receive and send
commands with the connected client.
This service can be used to change the data transfer methods used by the
Get client data and
Send to client services.
|
Argument |
Description |
Input |
0 |
Socket index |
Client socket index (0 offset) |
1 |
Receive encoding |
The encoding to use for receiving data from the connected client.
|
2 |
Send encoding |
The encoding to use for sending data to the connected client.
|
Output |
0 |
Succeeded |
Operation succeeded: TRUE or FALSE |
Set auto connect |
Enable/disable auto client connections. This service is called by a server-side socket
connection point to either automatically allow attempts by clients to connect to the server.
By default, automatic acceptance of client attempts to connect is disabled.
If auto connections are disabled then a custom event called "SocketEvent" is generated.
This event can be trapped by the
Windows Event or Windows Event Callback components.
To manually allow a client connection, call the
Enable client cnx service.
|
Argument |
Description |
Input |
0 |
Auto accept |
Automatically accept client connect requests |