About 774,000 results
Open links in new tab
  1. sockets - Simple TCP EchoServer in Python - Stack Overflow

    I found this script of TCP server which "echoes" back the data to the client. #!/usr/bin/env python import socket host = '' port = 50000 backlog = 5 size = 1024 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((host,port)) s.listen(backlog) while 1: client, address = s.accept() data = client.recv(size) if data: client.send(data)

  2. sockets - How to write a python echo server that doesn't disconnect ...

    I want to set up a simple echo server that just echoes back whatever the client sends to it. However, currently the server disconnects (the server socket closes) after it echoes back the first client message.

  3. How to make a simple multithreaded socket server in Python

    May 3, 2017 · How do I make a simple Python echo server that remembers clients and doesn't create a new socket for each request? Must be able to support concurrent access. I want to be able to connect once and continually send and receive data using this client or similar: host = raw_input("Server hostname or ip? ") port = input("Server port? ")

  4. Echo server using python and sockets - MyTroubleshooting.com

    Mar 8, 2020 · This post explains how to create a create a simple echo server using python and sockets. In the first example we will create a simple echo server allowing one connection and a simple echo client, in the second example we will improve the first example allowing multiple client to be connected.

  5. Socket Programming in Python - GeeksforGeeks

    Feb 28, 2023 · Socket programming is a way of connecting two nodes on a network to communicate with each other. One socket (node) listens on a particular port at an IP, while the other socket reaches out to the other to form a connection.

  6. Socket Programming in Python (Guide) – Real Python

    Dec 7, 2024 · A simple echo server in Python can be created using sockets to listen for client connections and echo back received messages. Handling multiple clients with Python sockets can be achieved using non-blocking sockets and the selectors module for concurrent connections.

  7. Python Socket Programming: Server and Client Example Guide

    Feb 21, 2025 · In this tutorial, you learned the basics of Python socket programming, including how to create a simple client-server architecture, handle multiple clients using threading, and understand the differences between TCP and UDP sockets.

  8. Example: A TCP Socket Echo Server in Python

    Nov 20, 2023 · In this article, I will show you how to write a simple TCP socket echo server in Python, which is a program that listens for incoming connections from TCP socket clients, and echoes back whatever data it receives from them.

  9. Echo Server and Client Programs in Python - SICORPS

    An echo server is a program that listens for incoming connections from clients (other computers or devices) and sends back whatever data it receives. It essentially acts as a mirror, reflecting the input sent to it by the client. Now, Let’s get cracking with some code! Here’s an example of what our echo server might look like:

  10. Python Socket Communication: Echo Client-Server - GitHub

    Echo Client: A Python script that connects to a server, sends a message, and prints the server's response. Echo Server: A Python script that listens for incoming client connections, receives messages, and sends back a response. Socket Communication: Uses TCP/IP to send and receive messages between the client and server.

  11. Some results have been removed
Refresh