source: trunk/cnxTst.py @ 2290

Revision 1549, 631 bytes checked in by tolteque, 2 years ago (diff)

o LoPlug?

  • Add PGService which is common to all plugins and services. Class used to build the full itemId.
  • Modify every where (I hope) itemId processing
  • there is still some troubles ...
Line 
1import socket
2import sys
3from time import *
4
5def cnxTest():
6  # Create and connect socket
7  print "create socket"
8  sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
9  print "socket created"
10  print "try to connect"
11  try:
12    sock.connect( ( 'localhost', 10312))
13    print "connected"
14  except socket.error, msg:
15    print msg
16
17  print "send frame"
18  sock.send( "0\x0A1|0.0\x0A2|14|52\x0A3\x0A4\x0A")
19  while(True):
20    buf = sock.recv(1024)
21    if buf == "":
22      return
23   
24  sleep(1)
25 
26# =================================================
27if __name__ == "__main__":
28  print "test start"
29  cnxTest()
30  print "test end"
Note: See TracBrowser for help on using the repository browser.