cmusatyalab / elijah-cloudlet

Elijah cloudlet system
http://elijah.cs.cmu.edu/
43 stars 13 forks source link

Add new command #20

Closed HelloWorldLiWenjie closed 10 years ago

HelloWorldLiWenjie commented 10 years ago

Thank you for your previous answer. The thread question turns out to be my own problem. I am now trying to add a new command.

I find out in the android side, client will send two commands to server, respectively are creating session and sending meta-file. Now, I want to add my own command after client receiving the synthesis success info.

I already defined the format and function in NetworkMsg.java and send it using sender.requestCommand(networkMsg). Before this line is executed, if(mClientSocket.isConnected() && (!mClientSocket.isClosed())) returns true so i think the socket is open now. However, there is no response in the server side. I log at the entrance of def handle(self): of class SynthesisHandler. It actually log the existing two commands but does not log my command.

It is very weird to me. Do you have any clue to help me solve it? Thank you.

krha commented 10 years ago

hello,

I think it is because the server close TCP connection after VM synthesis success. Basically, server need seprate connection connection for each command except MESSAGE_COMMAND_SEND_META and MESSAGE_COMMAND_SEND_OVERLAY.

That means, even though mClientSocket.isConnected() is true, the connection might be disconnected from the server-side. So, please make a new connection to send your custom command as you can see at CloudletDiscoveryAPI.asssociate() in Android client. Thank.

each command is performed in one connection. For example, creating session, performing VM synthesis, and terminating the VM you synthesized are all