Ignore:
Timestamp:
06/30/09 11:09:39 (15 years ago)
Author:
rissim
Message:
trigger: gui added, interface modified
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trigger/communication.py

    r52 r77  
    99unmarshall = cPickle.loads
    1010
    11 def send(channel, *args):
    12     buf = marshall(args)
    13     value = socket.htonl(len(buf))
    14     size = struct.pack("L",value)
    15     channel.send(size)
     11def send(channel, args):
     12    #print "will send: ", args
     13    args+="\n"
     14    buf = args #marshall(args)
     15    #value = socket.htonl(len(buf))
     16    value = str(len(buf))
     17    #size = struct.pack("i",value)
     18    print "length: ",len(buf)
     19    #print "SIZE: ",repr(size)
     20    #channel.send(value)
     21    buf+="\0"
    1622    channel.send(buf)
    17 
     23    #print 'sending: ',buf
     24    #print 'sent'
    1825def receive(channel):
    1926
    2027    size = struct.calcsize("L")
    2128    size = channel.recv(size)
     29    print "rec size: ",size
    2230    try:
    23         size = socket.ntohl(struct.unpack("L", size)[0])
     31        size = socket.ntohl(struct.unpack("i", size)[0])
     32        #print "unpacked: ",size
    2433    except struct.error, e:
    2534        return ''
Note: See TracChangeset for help on using the changeset viewer.