bcst: now forwarded to clients

This commit is contained in:
Carl Klemm 2019-06-10 17:20:56 +02:00
parent 6dbe2c26d8
commit eb6a202c71
2 changed files with 17 additions and 2 deletions

15
CMakeLists.txt Normal file
View File

@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 2.4)
project(serialmultiplexer)
set(SRC_FILES main.cpp serial_io.cpp Socket.cpp )
set(LIBS -pthread )
add_executable(${PROJECT_NAME} ${SRC_FILES})
target_link_libraries( ${PROJECT_NAME} ${LIBS})
set_target_properties( ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS -m64 LINK_FLAGS -m64)
add_definitions(" -std=c++11 -Wall ")
install(TARGETS serialmultiplexer RUNTIME DESTINATION bin)

View File

@ -229,10 +229,10 @@ int main(int argc, char* argv[])
if(config.verbose)
{
std::cout<<"bcst: ";
for( int j = 6; j < reclen; j++ )std::cout<<inBuffer[j];
for( int j = 0; j < reclen; j++ )std::cout<<inBuffer[j];
std::cout<<std::endl;
}
for(unsigned int j = 0; j < clientSockets.size(); j++) if(i != j) clientSockets[j]->send(inBuffer+6, reclen-6);
for(unsigned int j = 0; j < clientSockets.size(); j++) if(i != j) clientSockets[j]->send(inBuffer, reclen);
}
else if(strncmp( inBuffer, "reinitsp", 8) == 0 && serial != -1)