153 {
154 bool done = false;
155 std::string input;
157
158 while (!done) {
159 std::cout << "Enter Command: ";
160 std::getline(std::cin, input);
161
162 if (input == "quit") {
163 done = true;
164 } else if (input == "help") {
165 std::cout
166 << "\nCommand List:\n"
167 << "connect <ws uri>\n"
168 << "show <connection id>\n"
169 << "help: Display this help text\n"
170 << "quit: Exit the program\n"
171 << std::endl;
172 } else if (input.substr(0,7) == "connect") {
173 int id = endpoint.
connect(input.substr(8));
174 if (id != -1) {
175 std::cout << "> Created connection with id " << id << std::endl;
176 }
177 } else if (input.substr(0,4) == "show") {
178 int id = atoi(input.substr(5).c_str());
179
181 if (metadata) {
182 std::cout << *metadata << std::endl;
183 } else {
184 std::cout << "> Unknown connection id " << id << std::endl;
185 }
186 } else {
187 std::cout << "> Unrecognized Command" << std::endl;
188 }
189 }
190
191 return 0;
192}
int connect(std::string const &uri)
connection_metadata::ptr get_metadata(int id) const