go language basic network programming socket programming basic concepts

1. Network programming
socket
--> TCP, UDP
TCP: connection-oriented programming
is analogous to making phone calls
, data security, low efficiency (repeated confirmation, 3-way handshake)
UDP: connectionless programming
is analogous to writing
, data is insecure, high efficiency (Only responsible for sending data..)
2. Three elements of network programming
1.ip
computer address in the Internet, unique identification.
2.port
network application: port
0-65535 0-1024, public port number some ports that can be used 54321, 9527, 9528, 9529, 12345.... 3. Protocol:



go,java,python。。。。

Extended content:
network model
B/S
Browser/Server
        to access Taobao or JD.com
C/S
Client/Server
QQ, WeChat
server and client
server: provide services, passively wait
7*24
Client: obtain data, initiate connection actively one party



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325943129&siteId=291194637