Python Forum
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple TCP Server
#3
(May-11-2017, 02:58 AM)shift838 Wrote:     def run(self):
        while 1:
            print('Client sent:', self.sock.recv(1024).decode())
            self.sock.send(msg)
self.sock.close()?

If you're doing anything more than just messing around, you should probably use something designed for being fast at a low level, like Twisted (http://twistedmatrix.com/trac/)
Reply


Messages In This Thread
Simple TCP Server - by shift838 - May-11-2017, 02:58 AM
RE: Simple TCP Server - by sparkz_alot - May-11-2017, 02:14 PM
RE: Simple TCP Server - by nilamo - May-11-2017, 04:42 PM
RE: Simple TCP Server - by shift838 - May-12-2017, 12:36 AM
RE: Simple TCP Server - by nilamo - May-12-2017, 03:35 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Paramiko Server -- Exception (server): Error reading SSH protocol banner ujlain 3 10,691 Jul-24-2023, 06:52 AM
Last Post: Gribouillis
  Simple TCP Client and TCP Server Problem Vapulabis 5 5,966 Jul-12-2020, 05:09 PM
Last Post: ndc85430
  Selector file descriptor issue in simple multiclient server program dohpam1ne 0 3,679 May-28-2020, 02:39 PM
Last Post: dohpam1ne
  simple udp server/client cardmaker 2 4,838 Nov-26-2019, 12:36 AM
Last Post: micseydel
  Simple send and recive string Server/Client Epilepsy 1 3,488 May-01-2018, 08:17 PM
Last Post: ThiefOfTime

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020