Tag:socket

  • The record of socket stepping on the hole

    Time:2020-1-16

    Socket brief introduction Socket (duplex protocol)Two programs in the network exchange data through a two-way connection. We call one end of the connection socket Socket characteristics Built in connection retention Can realize two-way communication Socket classification Socket based on TCP Socket based on UDP Socket based on rawip Socket based on link layer Socket actual […]

  • [business learning] analysis of the way to improve the performance of server concurrent IO — from the basis of network programming to epoll

    Time:2019-12-22

    baiyan From the basic concept of network programming We often use HTTP protocol to transmit data of various formats. In fact, the bottom layer of HTTP application layer protocol is based on TCP protocol of transmission layer. TCP only treats these data as a series of meaningless data streams. Therefore, we can say:The client and […]

  • Best practice in dealing with network timeout

    Time:2019-12-7

    For users on the cloud, the timeout problem in the business log is often difficult to deal with, because 1) the problem may be in the cloud infrastructure layer, or in the business software layer, and the scope of troubleshooting is very wide; 2) such problems are often non recurring problems, and it is difficult […]

  • The implementation method of continuous transmission of large file with breakpoint in golang socket

    Time:2019-12-3

    In our daily programming, we will definitely encounter the use of socket to transfer the file content. If it is a large file, it can’t be transferred to half of it because it is broken for some reason, and then transfer the file content from the new one. Yes, we need to renew the transmission, […]

  • Make a simple chat room with node (with websocket tutorial)

    Time:2019-11-27

    I’ve been talking about theory before. Let’s talk about dry goods this time.By the way, let’s start with the zero row Vue series and write it later. After all, Youshen is Youshen. It’s really difficult to simulate Vue for a while. Go on to the point. (a node environment is needed here, on the computerIf […]

  • Analysis of okhttp source code (I) simple analysis of request and response process

    Time:2019-11-27

    This article briefly introduces the request and response process of okhttp. Article basedOkHttp3.14.3Edition 0 Preface ​ OkHttpAs the current Java based programming network request library, its popularity is needless to say. The articles and codes about the use, encapsulation and source code analysis of okhttp on the Internet have been put together by hundreds of […]

  • Summary of Linux socket common functions

    Time:2019-11-23

    ======== TCP ======== TCP_Server socket() bind() listen() accept() write() read() Close() and shutdown() TCP_Client socket() connect() Send() and recv()Close() and shutdown() ======== UDP ======== UDP_Server socket() bind() Sendto() and recvfrom()Close() and shutdown() UDP_Client socket() Sendto() and recvfrom()Close() and shutdown() getpeername() gethostname() ——————————————————————————–socket() We use the system call socket () to get the file descriptor:#include<sys/types.h>#include<sys/socket.h>int socket(int […]

  • Socket programming tutorial in simple Ruby

    Time:2019-11-19

    Ruby provides two levels of network access services. At the bottom, you can access the operating system. It allows you to implement the basic socket support for connection oriented and Connectionless Protocols for clients and servers. Ruby supports network protocols of applications, such as FTP, HTTP, etc. Whether it’s high-level or low-level. Ruby provides some […]

  • From simple to highly concurrent server (1)

    Time:2019-11-6

    A single threaded echo server Let’s start with a simple server.It can take a customer’s connection, receive a message, send it back, close the connection – done. We use BSD socket, which is common on Linux and IOS / OSX, to write the code of this server. The main part is as follows: (c + […]

  • What is the difference between socket and the socket returned by accept (FD)

    Time:2019-11-1

    The review of unix network programming Simply review the process of socket connection Socket () — get FD! Function: protocol family (IPv4, IPv6 or Unix) and socket interface type (byte stream, datagram or original socket interface) are specified. But no local or remote protocol address was specified. Definition: int socket (int family, int type, int […]

  • Swoole socket / websocket application heartbeat package

    Time:2019-10-29

    Swoole websocket application heartbeat package Premise:In the official group of swoole, someone asked, “my sokect / websocket client has been disconnected after a successful connection for some time, how can I keep it?” Causes of problem 1: In practical application, socket connection will be shut down by the host because there is no data communication […]

  • Record of socket trampling pit

    Time:2019-10-11

    Socket brief introduction Socket (duplex protocol)Two programs in the network exchange data through a two-way connection. We call one end of the connection socket. Socket characteristics Self-contained connection maintenance Two-way communication can be realized Socket classification TCP-based socket UDP-based socket RawIP-based socket Socket Based on Link Layer Socket actual combat socketClient.js var net = require(‘net’); […]