<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Go_echo_multiple_ports</id>
	<title>Go echo multiple ports - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Go_echo_multiple_ports"/>
	<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Go_echo_multiple_ports&amp;action=history"/>
	<updated>2026-04-19T22:01:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://tech.uvoo.io/index.php?title=Go_echo_multiple_ports&amp;diff=5106&amp;oldid=prev</id>
		<title>Busk: Created page with &quot;``` import socket import threading  def handle_client(client_socket):     while True:         data = client_socket.recv(1024)         if not data:             break         cl...&quot;</title>
		<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Go_echo_multiple_ports&amp;diff=5106&amp;oldid=prev"/>
		<updated>2024-03-23T14:43:34Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;``` import socket import threading  def handle_client(client_socket):     while True:         data = client_socket.recv(1024)         if not data:             break         cl...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;```&lt;br /&gt;
import socket&lt;br /&gt;
import threading&lt;br /&gt;
&lt;br /&gt;
def handle_client(client_socket):&lt;br /&gt;
    while True:&lt;br /&gt;
        data = client_socket.recv(1024)&lt;br /&gt;
        if not data:&lt;br /&gt;
            break&lt;br /&gt;
        client_socket.send(data)&lt;br /&gt;
    client_socket.close()&lt;br /&gt;
&lt;br /&gt;
def start_echo_server(port):&lt;br /&gt;
    server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)&lt;br /&gt;
    server.bind(('localhost', port))&lt;br /&gt;
    server.listen(5)&lt;br /&gt;
    print(f&amp;quot;Listening on port {port}...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    while True:&lt;br /&gt;
        client_socket, _ = server.accept()&lt;br /&gt;
        client_handler = threading.Thread(target=handle_client, args=(client_socket,))&lt;br /&gt;
        client_handler.start()&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    ports = [8080, 9090]  # List of ports to listen on&lt;br /&gt;
    for port in ports:&lt;br /&gt;
        threading.Thread(target=start_echo_server, args=(port,)).start()&lt;br /&gt;
```&lt;/div&gt;</summary>
		<author><name>Busk</name></author>
	</entry>
</feed>