Posts
Q&A
ํฌ์ฌ์ฒด ์๋ฒ ํ์ ์ง๋ฌธ์ ๋๋ค
๋ง๋์ง๋ ๋ชจ๋ฅด๊ฒ ๋๋ฐ ํฌํค ๊ฐ์ ๊ฒฝ์ฐ์๋ ์ ํ๋ ์ ํฌ์ฌ์ฒด ์์น(์๋ฒ ํ๋ ์), ํ ํ๋ ์ ํฌ์ฌ์ฒด ์์น ์ฌ์ด์ ์ถฉ๋์ฒด๋ฅผ ๋ง๋ค์ด์ ์ฒดํฌ ํ๋๊ฒ ๊ฐ์์ด์, ํฌ์ฌ์ฒด(๋ก์ผํ ํ์ ) ์ด ์๋ ๊ฒฝ์ฐ์๋ ์ฌ์ค์ 1ํ๋ ์ ray์ฒ๋ฆฌ๋ฅผ ํ๋ ๊ฒ์ผ๋ก ์๊ณ ์์ต๋๋ค
- 0
- 2
- 312
Q&A
์๋ฌ๊ฐ ๋ฐ์ํฉ๋๋ค..
์ฐ๊ฒฐํ๊ณ ๋ฐ๋ก ์ฐ๊ฒฐ์ ๋๋ ๊ฒฝ์ฐ ๋ฐ์ํฉ๋๋ค. ์๋ python ์ฝ๋๋ก ํ ์คํธ ํด๋ณด์๋ฉด ๋ฉ๋๋ค.import socket def check_tcp_connection(ip, port): try: # Create a new socket using the given IP and port with socket.create_connection((ip, port), timeout=5) as s: print(f"Successfully connected to {ip} on port {port}") except socket.error as e: print(f"Failed to connect to {ip} on port {port}. Error: {e}") if __name__ == "__main__": target_ip = "your ip" target_port = int("7777") check_tcp_connection(target_ip, target_port)
- 0
- 2
- 4.6K