Newbie Question: Sockets

Kevin Bass kbass1 at nc.rr.com
Tue Nov 5 19:22:45 EST 2002


"Grant Edwards" <grante at visi.com> wrote in message
news:slrnase1hp.b0s.grante at localhost.localdomain...
> 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...

Thanks for responding. :) I will try to be a little more clear this time :)

I received the results of  'The received data is  Mousey MooMousey MooMousey
MooMousey MooMousey MooMousey MooMousey Moo' when executing my socks. I
hoped to get the result of ''The received data is  Mousey Moo'

I have limited the number of bytes received in my code (data =
conn.recv(50)) and I have recieved favorable results. I received the results
of 'The received data is  Mousey Moo'.

Can the received data be placed into another value should as an array or
list?






More information about the Python-list mailing list