VC++ under Windows uses boost::asio + WSAEventSelect + WSACreateEvent to implement async-listen-accept socket-fd

What requirements would lead to giving up using boost::asio::ip::tcp::acceptor directly? to listen and accept socket instances from clients? Hypothetical scenario: We need to make the sockets that already know the IPEndPoint address endpoint work under the same context, because this group of sockets will copy data across each other. If we have multiple contexts, it […]

19.0 Boost is based on ASIO network programming technology

The Boost ASIO library is an open source network programming library based on the C++ language. The library provides a mature, efficient, cross-platform network API interface, and supports both synchronous and asynchronous modes. The ASIO library provides multiple I/O objects. , asynchronous timers, executable queues, signal operations, and coroutine support allow developers to easily write […]

boost-asio-1-timer usage

Article directory Preface timer Synchronous use of timers Using timers asynchronously Bind parameters to completion handler Synchronous completion handlers in multi-threaded programs Foreword There is no network library included in the C++ standard library. I need (familiarity with) a networking library that can serve as a “Swiss Army Knife” in my day-to-day network programming. Here, […]

Alien invasion armed spaceship (3)

Directory Table of contents Preface mind Mapping Project article list 1. Refactoring: module game_functions 2. Create the game_functions.py file 2.1, Import module 2.2. Transfer the exit game event 2.3, Modify alien_invasion.py file 2.3.1, Import module 2.3.2, Call function 2.4, Create the function update_screen() in the game_functions.py file 2.4.1, Create update_screen() function 2.4.2. Transfer game background, […]

C++ ASIO implements asynchronous socket management

Boost ASIO (Asynchronous I/O) is a C++ library for asynchronous I/O operations. The framework provides a convenient way to handle network communication, multi-threaded programming, and asynchronous operations. It is especially suitable for the development of network applications. This framework can be used from basic network communication to complex asynchronous operations, such as remote control programs, […]

Python actual combat [Alien Invasion] game and adapted it into [Messi vs Ronaldo] (fans live) – build environment, source code, read the highest score and generate executable .exe file

Article directory Preface Install Pygame Game implementation Read, write and store the highest score in [Alien Invasion] game Game source code alien_invasion.py game_functions.py ship.py alien.py bullet.py button.py scoreboard.py game_stats.py settings.py .bmp type files for spaceships and aliens Organize game programs into .exe files Step 1: Install the Pyinstaller library in pycharm Step 2: Generate .exe […]

Single file implementation of alien_invasion project

Step 1: Merge the code. After merging, the test can be run directly. There are 405 lines of code in total. Step 2: Delete duplicate import statements pygame.font does not need to be introduced separately The settings, game_stats, button, scoreboard, ship, and alien classes are directly defined in the file and do not need to […]

c3p0-0.9.1.2 of the database connection pool, APPARENT DEADLOCK occasionally occurs online, how to solve it?

Foreword This article is actually a continuation of the previous two articles, both of which talk about the c3p0 database connection pool on the positioning line, and the problem of connection leakage occurs. The second article mentioned that two parameters can be configured to find out where the code borrowed the connection and did not […]