HAN Pilot Platform
Demonstration Manual
56
www.terasic.com
September 6, 2019
Client Server Model
Most intercrosses’ communication uses the client server model. These terms refer to the two
processes which will be communicating with each other. One of the two processes, the client,
connects to the other process, the server typically to makes a request for information. A good
analogy is a person who makes a phone call to another person.
Notice that the client needs to know of the existence of and the address of the server, but the server
does not need to know the address of (or even the existence of) the client prior to the connection
being established.
Notice also that once a connection is established, both sides can send and receive information.
The system calls for establishing a connection which is somewhat different for the client and the
server, but both involve the basic construct of a socket. A socket is one end of an intercross’s
communication channel. The two processes each establish their own socket.
communication diagram between the client and server.
Figure 3-19 Client and Server communication
The steps involved in establishing a socket on the client side are as follows:
Create a socket with the
socket()
system call
Connect the socket to the address of the server using the
connect()
system call
Send and receive data. There are a number of ways to do this, but the simplest is to use the
read()
and
write()
system calls.
The steps involved in establishing a socket on the
server
side are as follows:
Create a socket with the
socket()
system call
Bind the socket to an address using the
bind()
system call. For a server socket on the
Содержание HAN Pilot Platform
Страница 1: ......
Страница 92: ...HAN Pilot Platform Demonstration Manual 91 www terasic com September 6 2019...