Python server from inetd?

Erno Kuusela erno-news at erno.iki.fi
Tue Apr 9 01:25:41 EDT 2002


In article <iml4bukknqf9nqe13h7dp0qco3qj2r86rt at 4ax.com>, Tim Roberts
<timr at probo.com> writes:

|   #! /usr/bin/python
|   import socket

|   client = socket.fromfd( 0, socket.AF_INET, socet.SOCK_STREAM )
|   while 1:
|     bfr = client.read(1024)
|     if not bfr:
|       break
|     ...

| But this does not work.  The "read" call returns 0 immediately, over and
| over, until the client exits.  I never get any data.

it shouldn't work, since socket objects don't have a read method, only
recv.  getting 0 sounds really odd, since both s.recv nor f.read only
return strings. are you sure you're interpreting this correctly?
can you post the real code?

  -- erno



More information about the Python-list mailing list