SAMv3 : protocol better specified, and small changes in the code reflecting the new protocol

This commit is contained in:
mkvore-commit
2009-04-05 21:32:43 +00:00
parent 2cf5221620
commit 6b825fbe25
11 changed files with 180 additions and 121 deletions

View File

@ -44,16 +44,18 @@ def accept() :
sock.send("HELLO VERSION MIN=3.0 MAX=3.0\n")
sys.stdout.write(sock.recv(1000))
sock.send("STREAM ACCEPT ID=" + name + silent+"\n")
print "STREAM ACCEPT ID="+name+silent+"\n"
print "STREAM ACCEPT ID="+name+silent
if (silent==" SILENT=false") :
sys.stdout.write( sock.recv(100) )
return sock
def echo( sock, lines ) :
l = 0
while lines==-1 or l<lines :
chunk = sock.recv(1000)
sys.stdout.write(chunk)
if lines!=-1 : l = l + 1
if not chunk : break
print chunk
sock.send(chunk)
print