/******************************************************************************* * Copyright (c) 2018 INSA - GEI, Toulouse, France. * All rights reserved. This program and the accompanying materials * are made available "AS IS", without any warranty of any kind. * * INSA assumes no responsibility for errors or omissions in the * software or documentation available. * * Part of code Copyright ST Microelectronics. * * Contributors: * Lucien Senaneuch - Initial API and implementation * Sebastien DI MERCURIO - Maintainer since Octobre 2018 *******************************************************************************/ #include #include "Robot.h" #include "TcpServer.h" int main (void) { TcpServer server; int clientFD; string msgIn, msgOut,tmp; bool finish; Robot robot; cout << "TCP server example" << endl; cout << "Bind and listen on port 1337: "; try { server.Listen(1337); } catch ( const invalid_argument &ia ) { cerr << "Error binding server: " << ia.what() << endl; return 1; } cout << "Ok" <