Files
hakorune/local_tests/test_socket_echo.hako

22 lines
594 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 🔌 SocketBox簡単テストTCP通信
static box Main {
init { console }
main() {
me.console = new ConsoleBox()
me.console.log("🔌 TCP通信テスト...")
// シンプルなTCPクライアント
local socket = new SocketBox()
// Google DNSに接続してテスト
socket.connect("8.8.8.8", 53)
me.console.log("✅ 接続成功: 8.8.8.8:53")
// 切断
socket.close()
me.console.log("✅ 切断完了")
return "ソケットテスト完了"
}
}