I have following code where my controller is waiting for a client to send a
file through port 6633 and I will use the file to add flows.. (class
ReceiverFile:).. When client send the file, controller shows the following
message..
connected socket:<eventlet.greenio.GreenSocket object at 0x34ff9d0>
address:('10.80.25.115', 47886)
EVENT ofp_event->switches EventOFPStateChange
<ryu.controller.controller.Datapath object at 0x34f7910>
But it does not process the other part of the class.. Highly appreciate if
you could please tell me where I am going wrong..
############################################################
class SwitchEventApp(app_manager.RyuApp):
_CONTEXTS = {'switches': switches.Switches,}
def __init__(self, *args, **kwargs):
super(SwitchEventApp, self).__init__(*args, **kwargs)
@set_ev_cls(EventSwitchEnter)
def _ev_switch_enter_handler(self, ev):
datapath = ev.switch.dp
ofproto = datapath.ofproto
parser = datapath.ofproto_parser
class ReceiverFile:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('I am here in ReceiverFile class')
def __init__(self):
port = 6633
self.sock.bind((' ', port))
self.listen()
def listen(self):
self.sock.listen(5)
print socket.gethostname() + " is listening on 6633."
while True:
conn, addr = self.sock.accept()
print 'Accepted one connection..'
thread.start_new_thread(self.receive, (conn,))
def receive(self, conn):
while True:
data = conn.recv(1024)
print('I am here: calling Read_ReceiveFile with %s'
% data)
addflows #############
if not data: break
conn.close()
print 'Closed one connection'
--
Best Regards,
Windhya Rankothge,
Universitat Pompeu Fabra,
Barcelona.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel