mirror of
https://github.com/encounter/ghidra-cli.git
synced 2026-07-10 03:18:56 -07:00
15 lines
414 B
Rust
15 lines
414 B
Rust
//! Transport helpers for bridge TCP communication.
|
|
//!
|
|
//! The Java bridge uses newline-delimited JSON over TCP.
|
|
//! This module provides minimal transport utilities.
|
|
|
|
use std::net::TcpStream;
|
|
|
|
/// Check if a TCP port is reachable on localhost.
|
|
#[allow(dead_code)]
|
|
pub fn port_reachable(port: u16) -> bool {
|
|
TcpStream::connect(format!("127.0.0.1:{}", port))
|
|
.map(|_| true)
|
|
.unwrap_or(false)
|
|
}
|