Re: socket issue with recv()

2014-08-24 Thread dieter
Arthur Clarck aclar...@gmail.com writes: ... The problem I have now is the following. I have a script to connect to some telecom service. The script is forking (parent/child) The child is only reading what comes from the remote server. Here the problematic code: total = '' while True:

socket issue with recv()

2014-08-23 Thread Arthur Clarck
Hello, I am starting socket scripting with python. I do understand from the doc that a socket is bmocking by default. I wrote 2 basics script to verify this behaviour. my tcp_server.py: import socket, sys s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) HOST = '192.168.0.103' PORT = 1060

Re: socket issue with recv()

2014-08-23 Thread Arthur Clarck
I forgot to mention that with this code: total = '' while True: data = s.recv(1024) total += data if (total != ''): print total total = '' Everything is fine. I am still looping but I get the complete data flow sent by the remote server. The data flow is not corrupted

Re: socket issue with recv()

2014-08-23 Thread Marko Rauhamaa
Arthur Clarck aclar...@gmail.com: What is happening is that I got some datas from the remote site, Something like 'Contacting BH: ...' But directly followed by 'remote site is closed. This works: #!/usr/bin/env python3