Re: Socket and cycle problem

2008-05-13 Thread petr . poupa
On 12 Kvě, 21:06, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Mon, 12 May 2008 11:16:08 -0700 (PDT), [EMAIL PROTECTED] wrote: > > [snip] > > >My script send me via 3883 port (VRPN) data, but only once. I need > >listening this port countinously. > >So I need make some loop to print data fr

Re: Socket and cycle problem

2008-05-12 Thread castironpi
On May 12, 2:06 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Mon, 12 May 2008 11:16:08 -0700 (PDT), [EMAIL PROTECTED] wrote: > > [snip] > > >My script send me via 3883 port (VRPN) data, but only once. I need > >listening this port countinously. > >So I need  make some loop to print data

Re: Socket and cycle problem

2008-05-12 Thread Jean-Paul Calderone
On Mon, 12 May 2008 11:16:08 -0700 (PDT), [EMAIL PROTECTED] wrote: [snip] My script send me via 3883 port (VRPN) data, but only once. I need listening this port countinously. So I need make some loop to print data from 3883 port permanent. Data that I recevied looks liek this: receive data fro

Re: Socket and cycle problem

2008-05-12 Thread petr . poupa
On 12 Kvě, 19:16, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Mon, 12 May 2008 09:19:48 -0700 (PDT), [EMAIL PROTECTED] wrote: > > > [snip] > > >> >Where is the mistake? I dont know. > > >> You cannot reconnect a socket. You need to create a new one for each > >> connection. It's also almo

Re: Socket and cycle problem

2008-05-12 Thread Jean-Paul Calderone
On Mon, 12 May 2008 09:19:48 -0700 (PDT), [EMAIL PROTECTED] wrote: [snip] >Where is the mistake? I dont know. You cannot reconnect a socket. You need to create a new one for each connection. It's also almost certainly the case that the way you are receiving data is incorrect. There is no g

Re: Socket and cycle problem

2008-05-12 Thread petr . poupa
On 12 Kvě, 17:54, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Mon, 12 May 2008 08:34:07 -0700 (PDT), [EMAIL PROTECTED] wrote: > >Hello, > >I am beginner but so I need help. I have small script for receive data > >from port 3883, but it print only once. > > >import socket > > >HOST = 'localh

Re: Socket and cycle problem

2008-05-12 Thread Jean-Paul Calderone
On Mon, 12 May 2008 08:34:07 -0700 (PDT), [EMAIL PROTECTED] wrote: Hello, I am beginner but so I need help. I have small script for receive data from port 3883, but it print only once. import socket HOST = 'localhost' PORT = 3883 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((

Socket and cycle problem

2008-05-12 Thread petr . poupa
Hello, I am beginner but so I need help. I have small script for receive data from port 3883, but it print only once. import socket HOST = 'localhost' PORT = 3883 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((HOST, PORT)) data = s.recv(2048) s.close() print 'receive data from s