Re: sending binary data over sockets

2006-07-03 Thread Simon Forman
Grant Edwards wrote: > On 2006-07-03, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > My problem now, is that I need to send certain binary data over a > > socket. That is, I want to make some bytes, and stuff them in a TCP > > packet, send them down the pipe, and then listen for a response. ...

Re: sending binary data over sockets

2006-07-03 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > Greetings, since there was no reponse to my previous post about an > existing FastCGI server in python, I've taken to writing my own. (which > of course I'll share--*if* there's something to share ;) > > My problem now, is that I need to send certain binary data over a >

Re: sending binary data over sockets

2006-07-03 Thread thorley
> Are those not the four octets you wanted to send? Yes. My understanding of struct was broken. Sukanta corrected it for me. thank you -- matthew -- http://mail.python.org/mailman/listinfo/python-list

Re: sending binary data over sockets

2006-07-03 Thread thorley
> It will send the 4 bytes, binary, and not the string as you assumed. If > you want to satisfy yourself, run tcpdump (or ethereal) to observe what > is being sent. Thanks very much for the prompt reply. I'll take your word for it. I actually tried ethereal to verify my hypothesis before posting,

Re: sending binary data over sockets

2006-07-03 Thread thorley
> Python strings are binary data and can contain > - in oppostion to e.g. C-strings - null-bytes. > > So it is perfectly alright to send "only" strings over a socket. Agreed. I wasn't trying to imply it was 'wrong' just that the receiving application wouldn't interpret strings correctly. -- ht

Re: sending binary data over sockets

2006-07-03 Thread Grant Edwards
On 2006-07-03, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > My problem now, is that I need to send certain binary data over a > socket. That is, I want to make some bytes, and stuff them in a TCP > packet, send them down the pipe, and then listen for a response. > > socket.send, as best I can te

Re: sending binary data over sockets

2006-07-03 Thread Sukanta
[EMAIL PROTECTED] wrote: > Greetings, since there was no reponse to my previous post about an > existing FastCGI server in python, I've taken to writing my own. (which > of course I'll share--*if* there's something to share ;) > > My problem now, is that I need to send certain binary data over a >

Re: sending binary data over sockets

2006-07-03 Thread Diez B. Roggisch
Premature sending syndrome... Diez B. Roggisch schrieb: > [EMAIL PROTECTED] schrieb: >> Greetings, since there was no reponse to my previous post about an >> existing FastCGI server in python, I've taken to writing my own. (which >> of course I'll share--*if* there's something to share ;) >> >> My

Re: sending binary data over sockets

2006-07-03 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Greetings, since there was no reponse to my previous post about an > existing FastCGI server in python, I've taken to writing my own. (which > of course I'll share--*if* there's something to share ;) > > My problem now, is that I need to send certain binary data over a

sending binary data over sockets

2006-07-03 Thread thorley
Greetings, since there was no reponse to my previous post about an existing FastCGI server in python, I've taken to writing my own. (which of course I'll share--*if* there's something to share ;) My problem now, is that I need to send certain binary data over a socket. That is, I want to make some