1Panel/agent
KOMATA 38985671c6
perf: improve getNetConnections function and Websocket handling (#11269)
* feat: Enhance WebSocket client functionality and improve data processing

- Reduced message queue size in WebSocket client from 100 to 32.
- Introduced atomic boolean to track client closure state.
- Added SendPayload method to handle message sending with queue management.
- Updated ProcessData function to utilize SendPayload for sending responses.
- Expanded netTypes to include both IPv4 and IPv6 protocols in network connection retrieval.
- Improved net connection processing by using a map for process names, enhancing efficiency.

* feat: Enhance WebSocket client and process data handling

- Added synchronization with sync.Once for safe closure of WebSocket client.
- Updated message queue size to a constant for better maintainability.
- Implemented context timeouts for process data retrieval to prevent blocking.
- Improved network connection handling by utilizing a more efficient method for retrieving connections.
- Introduced a new function to determine connection types based on protocol family.

* feat: Enhance network connection retrieval and process name mapping

- Updated getNetConnections function to improve efficiency by using maps for process names and connections.
- Introduced a new helper function to retrieve process names from the filesystem or process context.
- Enhanced filtering logic for network connections based on process ID, name, and port.
- Increased initial capacity for connection results to optimize performance.

* refactor: Rename SendPayload method to Send in WebSocket client

- Updated the SendPayload method to be more succinctly named Send for clarity.
- Ensured the method continues to handle message sending while maintaining existing functionality.

* refactor: Update ProcessData and getNetConnections for improved clarity and efficiency

- Replaced SendPayload method calls with Send for consistency in WebSocket message handling.
- Enhanced getNetConnections function by refining process name retrieval and filtering logic.
- Improved error handling in getProcessNameWithContext for better robustness.

* refactor: Simplify WebSocket client closure and reading logic

- Removed unnecessary synchronization for closing the WebSocket client.
- Updated the Read method to handle message reading directly without a separate Close method.
- Ensured the Socket is closed properly after reading messages to prevent resource leaks.
2025-12-09 17:30:12 +08:00
..
app pref: Optimize backup account code structure (#11261) 2025-12-08 18:22:59 +08:00
buserr
cmd/server refactor: remove debug cmd for agent and core (#11009) 2025-11-20 08:31:03 +00:00
constant feat: Cronjob reports add an unexecuted status (#10866) 2025-11-05 07:30:25 +00:00
cron fix: resolve Google Drive token refresh failure (#9298) 2025-06-26 07:37:22 +00:00
global feat: GPU monitoring data supports persistence (#11051) 2025-11-24 07:59:15 +00:00
i18n fix: resolve i18n file loading failure issue (#11164) 2025-12-03 10:08:20 +08:00
init refactor: Refactored agent core.db loading logic (#11175) 2025-12-04 11:15:40 +08:00
log fix: Fix the backup account synchronization exception (#8083) 2025-03-06 16:25:05 +08:00
middleware fix: Resolve certificate validate failure Issues (#9698) 2025-07-28 15:36:10 +08:00
router pref: Optimize backup account code structure (#11261) 2025-12-08 18:22:59 +08:00
server chore: Optimize iptables initial state loading speed (#11085) 2025-11-26 22:29:48 +08:00
utils perf: improve getNetConnections function and Websocket handling (#11269) 2025-12-09 17:30:12 +08:00
go.mod feat: Add support for AWS Route 53 DNS provider (#11158) 2025-12-02 18:20:35 +08:00
go.sum feat: Add support for AWS Route 53 DNS provider (#11158) 2025-12-02 18:20:35 +08:00