About 351,000 results
Open links in new tab
  1. Sending string via socket (python) - Stack Overflow

    Jan 20, 2014 · First of all, you need to either accept the client (server side) before going into your while 1 loop because in every loop you accept a new client, or you do as i describe, you toss the client into a separate thread which you handle on his own from now on. Exactly what you asked for, "something like a chat application". This IS a chat application.

  2. How to send a message from the server to a client using sockets

    Are you looking to just send a message on a connection event? You are already sending to the client when you call s.sendto after getting message from a call to raw_input. Since this is the …

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

    Dec 7, 2024 · Socket programming in Python involves using sockets to establish communication between a server and clients over a network. A simple echo server in Python can be created using sockets to listen for client connections and echo back received messages.

  4. Socket Programming in Python - GeeksforGeeks

    Feb 28, 2023 · For sending data the socket library has a sendall function. This function allows you to send data to a server to which the socket is connected and the server can also send data to the client using this function. Server:

  5. 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.

  6. Socket Programming HOWTO — Python 3.13.3 documentation

    1 day ago · # create an INET, STREAMing socket serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # bind the socket to a public host, and a well-known port serversocket.bind((socket.gethostname(), 80)) # become a server socket serversocket.listen(5)

  7. Send () function of python socket class - Pythontic.com

    The send () function sends data from one socket to another connected socket. It works on TCP based sockets, both clients and the client-connected sockets at the server side.

  8. How to send and receive messages using Python sockets

    Python sockets provide a powerful tool for network communication, enabling you to send and receive messages across different systems. In this tutorial, we will guide you through the process of using Python sockets to establish connections, transmit data, and receive responses.

  9. A Complete Guide to Socket Programming in Python - DataCamp

    Aug 18, 2023 · In this article, we will cover the basics of socket programming and provide a step-by-step guide to creating socket-based client and server applications using Python.

  10. Python Socket Programming Guide (With Examples)

    Sep 5, 2023 · Once the connection is established, we can send and receive data using the send() and recv() methods. Here’s an example: s.send(b'Hello, Server!') # Received from server: b'Hello, Client!' In this code, s.send(b'Hello, Server!') sends a message to the server.

  11. Some results have been removed
Refresh