Solvline PB2xxxUG User Manual

Page 97

Advertising
background image

1) Passive Programming

Set the handshaking method to passive in the Webpage Connection Setting.
Passive handshaking makes the Portbase socket to be on the server side, waiting for a connection
request from the outside.

Portbase’s sockets 4001 to 4016 are firmly connected to serial ports 1 to 16 respectively. For
instance, socket 4002 is conncted to serial port 2.

The server’s waiting sequence for connection requests from client

CAsyncSocket() -----– Create a socket object.
|
Bind() ------------ Announce the program is ready for communication.
|
Listen() ---------- Wait for connection request from client.
|
Receive() ---------- Wait until the client requests a sendto.
|
Send() ------------- Send a HTML file and others in response to the request from client.

2) Active Programming

If you set the handshaking method to active in the Webpage Connection Setting, the socket acts in
Active mode.
Active handshaking makes the Portbase serial ports to be on the client side trying to connect to the
remote client’s IP address and socket number.
If the Portbase has started completely, you can see that sockets 4001 to 4016 are automatically
connected to serial ports 1 to 16.

Connection Request Order from client to server

CAsyncSocket() – --- Create a socket object.
|
Connect() ------- Request for connection to server.
|
Send()- –-------- Send a HTML file and others in response to the request from server.
|

97

Advertising