EasyManua.ls Logo

SystemBase Portbase-3010 - Page 113

SystemBase Portbase-3010
118 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Portbase User Guide
4. Linux/Unix Socket Program
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 400x are firmly connected to serial ports 1 to x respectively. For
instance, socket 4002 is connected to socket 2.
The server’s waiting sequence for connection requests from client
socket() -----– Create a socket object.
|
bind() ------ Announce the program is ready for communication.
|
listen() ----- Wait for connection request from client..
|
read() ------- Wait until the client requests a sendto.
|
write() ------- 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 400x are automatically
connected to serial ports 1 to x serial ports.
Connection Request Sequence from client to server
socket() – --- Create a socket object.
|
connect() -- Request for connection to server.
113

Table of Contents