File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44! .vscode /launch.json
55! .gitignore
66! tarCommands.sh
7+ ! readme.txt
78
89! Client
910! Client /**
Original file line number Diff line number Diff line change @@ -3,14 +3,15 @@ executable_name:=BGSclient
33# compile_flags:=-c -Wall -Weffc++ -g -std=c++11 -Iinclude -O3 -pthread
44# link_flags:=-lboost_system -lpthread -lstdc++ -lboost_thread
55
6- compile_flags: =-c -Iinclude -pthread -std=c++11 -O3 -Wall -Weffc++ -g
7- link_flags: =-lboost_system -lboost_thread -lpthread
8- object_files: = bin/BGSclient.o \
9- bin/clientConnectionHandler.o \
10- bin/readFromKeyboardTask.o \
11- bin/readFromSocketTask.o \
12- bin/clientProtocol.o \
13- bin/clientEncoderDecoder.o
6+ compile_flags: =-c -Iinclude -std=c++11 -Wall -Weffc++ -g
7+ link_flags: =-lboost_thread -lboost_system -lpthread -lstdc++ -pthread -L/usr/lib/x86_64-linux-gnu
8+ object_files: = \
9+ bin/BGSclient.o \
10+ bin/clientConnectionHandler.o \
11+ bin/readFromKeyboardTask.o \
12+ bin/readFromSocketTask.o \
13+ bin/clientProtocol.o \
14+ bin/clientEncoderDecoder.o
1415
1516
1617# all: clear compile link
@@ -33,7 +34,7 @@ compile: client
3334
3435link : $(object_files )
3536 echo " [*] Linking everything..."
36- g++ $(link_flags ) -o bin/$(executable_name ) $(object_files )
37+ g++ $(link_flags ) -o bin/$(executable_name ) $(object_files ) -lboost_system
3738
3839
3940check : bin/studio ExampleInput.txt # TODO
Original file line number Diff line number Diff line change 1+ CXX = g++
2+ CXXFLAGS = -c -Wall -Weffc++ -g -std=c++11
3+ CPPFLAGS = -I ./include -MMD -MP
4+ LDFLAGS := -lboost_system -lboost_thread -lpthread
5+
6+ SRCS = $(wildcard ./src/*.cpp)
7+ OBJS = $(patsubst ./src/%.cpp,./bin/%.o, $(SRCS))
8+ DEPS := $(patsubst %.o,%.cpp, $(OBJS))
9+
10+ # default target
11+ all: ./bin/BGSclient
12+
13+ # build studio
14+ ./bin/BGSclient: $(OBJS)
15+ @echo "Building ..."
16+ $(CXX) $(OBJS) -o $@ $(LDFLAGS)
17+ @echo "Finished building"
18+
19+ # build cpp files
20+ ./bin/%.o: ./src/%.cpp
21+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@
22+
23+ # clean build files
24+ clean:
25+ @rm -f ./bin/*
26+
27+ -include $(DEPS)
Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ void parseFollowUnfollow(string &output) {
199199void parseStatLogStat (string &output) {
200200 output += " " ;
201201
202- for (int index = 4 ; index < bytes.size () /* bytes[index] != ';' */ ; index += 8 ) {
202+ for (size_t index = 4 ; index < bytes.size () /* bytes[index] != ';' */ ; index += 8 ) {
203203 // cout << "[*] parseStatLogStat(), inside loop, index=" << index ;
204204 // cout << ", byte=" << bytes[index] << endl;
205205
Original file line number Diff line number Diff line change 1+ readme.txt:
2+
3+ 1) how to run our code:
4+ compilation:
5+ (from the Client directory:)
6+ make
7+
8+ (from the Server directory:)
9+ mvn clean
10+ mvn package
11+
12+ 1.1) command line for each server:
13+ (from the Server directory:)
14+ (to run TPC:)
15+ java -jar target/bgs_tpc.jar <port>
16+
17+ (to run Reactor:)
18+ java -jar target/bgs_reactor.jar <num_threads> <port>
19+
20+ 1.2) Examples for each command:
21+
22+ register name1 pass123 12-12-2000
23+ register name2 pass123 12-12-2001
24+
25+ login name1 pass1 1
26+
27+ logout
28+
29+ follow 0 name1
30+ follow 1 name1
31+
32+ post the user @name1 listens to me
33+
34+ pm name1 war is bad
35+
36+ logstat
37+
38+ stat name1 name2
39+
40+ block name1
41+
42+ 2) We stored the filtered set of word inside HashSet in the static class FilteredWordsWrapper, which is inside the PM_Message class (bgu.spl.net.impl.messages.FilteredWordsWrapper)
Original file line number Diff line number Diff line change 11ARCHIVE=submission.tar.gz
22
3- tar -czf $ARCHIVE Client/src Client/include/ Client/bin/.gitkeep Client/makefile Server/src/ Server/pom.xml
3+ tar -czf $ARCHIVE Client/src Client/include/ Client/bin/.gitkeep Client/makefile Server/src/ Server/pom.xml readme.txt
44tar -tvf $ARCHIVE
55
You can’t perform that action at this time.
0 commit comments