Newbie Question: Sockets

Grant Edwards grante at visi.com
Tue Nov 5 18:46:01 EST 2002


In article <a_Xx9.45531$ku2.2717764 at twister.southeast.rr.com>, Kevin Bass wrote:

> I am attempting to process data within a socket. The socket establishes =
> communications on both servers but the data does not come out the way = that
> I want it. How do I store the retrieved data into an array or = another
> value? If there are multiple values, how can I store this = information?
> Thanks!
> 
> 
> client.py
>=3D=3D=3D=3D=3D=3D=3D

Enough with the MIME stuff already... :)

Since you don't say what's wrong, (and I don't care to run your code and try
to figure out what it's supposed to do) I'll take a guess: You're using a
TCP/IP connection and you expect it to act like a datagram service when it's
actually a byte stream service.

There are no record boundaries in TCP/IP.  

One end may call send() four times with 25 bytes each time.  The other end
may receive that data as a single 100 byte chunk, as 5 20-byte chunks, or as
100 single byte chunks.

><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

And for the love of Usenet, ditch the HTML...

-- 
Grant Edwards                   grante             Yow!  The FALAFEL SANDWICH
                                  at               lands on my HEAD and I
                               visi.com            become a VEGETARIAN...



More information about the Python-list mailing list