We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I used the following Python code as a client.
import socket target_ip = "192.168.1.3" target_port = 8080 buffer_size = 4096 i = 0 while True: if i == 10000: break tcp_client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) tcp_client.connect((target_ip,target_port)) tcp_client.send(str(i).encode()) response = tcp_client.recv(buffer_size) print("[*]Received a response : {}".format(response)) i = i + 1
Then, I ran the following server code in Swift.
func echoService(client: TCPClient) { print("Newclient from:\(client.address)[\(client.port)]") var d = client.read(1024*10) client.send(data: d!) client.close() } func testServer() { let server = TCPServer(address: "192.168.1.3", port: 8080) switch server.listen() { case .success: while true { if var client = server.accept() { echoService(client: client) } else { print("accept error") } } case .failure(let error): print(error) } }
The code ran normally up to the 400th time, but after about 400 times, an error occurred in Python.
The error details are as follows
An existing connection was forcibly closed by the remote host
Does anyone know what causes this error?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I used the following Python code as a client.
Then, I ran the following server code in Swift.
The code ran normally up to the 400th time, but after about 400 times, an error occurred in Python.
The error details are as follows
An existing connection was forcibly closed by the remote host
Does anyone know what causes this error?
The text was updated successfully, but these errors were encountered: