Exemplo n.º 1
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from ComssService.dev.control import DevServiceController
import random
import time

desc_file_name = "decision_maker_service1.xml"
controller = DevServiceController(desc_file_name)

UPDATE_PARAMS_INTERVAL = 20

try:
    iters_to_update = UPDATE_PARAMS_INTERVAL
    while True:
        controller.send_data("2", "1")
        print "1"
        time.sleep(0.5)
except:
    raise
finally:
    controller.close_all_connections()
Exemplo n.º 2
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from ComssService.dev.control import DevServiceController
import random
import time

chars_to_send = 'qwertyQWERTY'

desc_file_name = 'servers_emulator.xml'
controller = DevServiceController(desc_file_name)
try:
    while True:
        char = random.choice(chars_to_send)
        controller.send_data('1', char)
        print "SENT:", char
        time.sleep(0.5)
except:
    raise
finally:
    controller.close_all_connections()
Exemplo n.º 3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from ComssService.dev.control import DevServiceController
import time
import re

desc_file_name = 'servers_emulator.xml'
controller = DevServiceController(desc_file_name)
try:
    print("##### Server SMTP Start #####")

    with open('data/smtp_server.log', 'rb') as file:
        block = ''
        for line in file.readlines():
            line = line.strip()
            block_end = re.search('[-]*=_[0-9]*-[0-9]*-[0-9]*', line)
            block += line
            if block_end:
                controller.send_data('2', block)
                print "SENT:", block
                time.sleep(1)
except:
    raise
finally:
    controller.close_all_connections()
Exemplo n.º 4
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from ComssService.dev.control import DevServiceController
import fileinput

desc_file_name = 'byte_extractor_service.xml'
controller = DevServiceController(desc_file_name)

try:
    for line in fileinput.input(['../servers_emulator/data/http_server.log']):
        controller.send_data('1', line)
        print line
except:
    raise
finally:
    controller.close_all_connections()
Exemplo n.º 5
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from ComssService.dev.control import DevServiceController
import fileinput

desc_file_name = "address_extractor_service.xml"
controller = DevServiceController(desc_file_name)

try:
    for line in fileinput.input(["../servers_emulator/data/http_server.log"]):
        controller.send_data("1", line)
        print line
except:
    raise
finally:
    controller.close_all_connections()