Skip to content

Commit

Permalink
Make multiple vnc sessions work
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishal Gowda committed Mar 7, 2017
1 parent e5ae0c2 commit 9f4d151
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
10 changes: 9 additions & 1 deletion droid_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
"droids": [
{
"port": "5554",
"avd": "nexus6-android7"
"avd": "nexus6-android7",
"display": "1",
"ws_port": "6080"
},
{
"port": "5556",
"avd": "nexus6-android7-2",
"display": "2",
"ws_port": "6081"
}
]
}
5 changes: 4 additions & 1 deletion hedroid/worker/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def start(self):
proc.stop()
except:
pass
raise

def stop(self):
logger.debug('Stopping droid')
Expand All @@ -55,7 +56,7 @@ def __init__(self):
self.dpi = 560
self.dim = '720x1280x24'
self.clip = '530x965+15+30'
self.ws_port = 6080
self.ws_port = '6080'

def set_port(self, port):
self.port = port
Expand Down Expand Up @@ -138,6 +139,8 @@ def setup(self):
self.start_droid(droid)
except IndexError:
break
except:
pass

def count(self):
return len(self.initialised)
Expand Down
8 changes: 4 additions & 4 deletions hedroid/worker/thrift_server.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import atexit

import requests
Expand Down Expand Up @@ -37,10 +38,9 @@ def setup(self):
config = get_config()
builder = DroidBuilder()
for droid in config['droids']:
if droid['port']:
builder.set_port(droid['port'])
if droid['avd']:
builder.set_avd(droid['avd'])
for key, value in droid.iteritems():
func = getattr(builder, "set_{}".format(key))
func(value)
self.coordinator.add_droid(builder.build())
# Start all endpoints now
self.coordinator.setup()
Expand Down
2 changes: 1 addition & 1 deletion start_worker_thrift.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env python
from worker.thrift_server import start_server
from hedroid.worker.thrift_server import start_server


if __name__ == '__main__':
Expand Down

0 comments on commit 9f4d151

Please sign in to comment.