forked from xiaojiaqi/C1000kPracticeGuide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Max <[email protected]>
- Loading branch information
Showing
25 changed files
with
1,275 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
# BasedOnStyle: LLVM | ||
AccessModifierOffset: -2 | ||
ConstructorInitializerIndentWidth: 4 | ||
AlignEscapedNewlinesLeft: false | ||
AlignTrailingComments: true | ||
AllowAllParametersOfDeclarationOnNextLine: true | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakTemplateDeclarations: false | ||
AlwaysBreakBeforeMultilineStrings: false | ||
BreakBeforeBinaryOperators: false | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializersBeforeComma: false | ||
BinPackParameters: true | ||
ColumnLimit: 80 | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: false | ||
DerivePointerBinding: false | ||
ExperimentalAutoDetectBinPacking: false | ||
IndentCaseLabels: false | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
ObjCSpaceBeforeProtocolList: true | ||
PenaltyBreakBeforeFirstCallParameter: 19 | ||
PenaltyBreakComment: 60 | ||
PenaltyBreakString: 1000 | ||
PenaltyBreakFirstLessLess: 120 | ||
PenaltyExcessCharacter: 1000000 | ||
PenaltyReturnTypeOnItsOwnLine: 60 | ||
PointerBindsToType: false | ||
SpacesBeforeTrailingComments: 1 | ||
Cpp11BracedListStyle: false | ||
Standard: Cpp03 | ||
IndentWidth: 2 | ||
TabWidth: 8 | ||
UseTab: Never | ||
BreakBeforeBraces: Attach | ||
IndentFunctionDeclarationAfterType: false | ||
SpacesInParentheses: false | ||
SpacesInAngles: false | ||
SpaceInEmptyParentheses: false | ||
SpacesInCStyleCastParentheses: false | ||
SpaceAfterControlStatementKeyword: true | ||
SpaceBeforeAssignmentOperators: true | ||
ContinuationIndentWidth: 4 | ||
... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
################################################################################ | ||
# Automatically-generated file. Do not edit! | ||
################################################################################ | ||
|
||
-include ../makefile.init | ||
|
||
RM := rm -rf | ||
|
||
# All of the sources participating in the build are defined here | ||
-include sources.mk | ||
-include src/subdir.mk | ||
-include subdir.mk | ||
-include objects.mk | ||
|
||
ifneq ($(MAKECMDGOALS),clean) | ||
ifneq ($(strip $(C++_DEPS)),) | ||
-include $(C++_DEPS) | ||
endif | ||
ifneq ($(strip $(C_DEPS)),) | ||
-include $(C_DEPS) | ||
endif | ||
ifneq ($(strip $(CC_DEPS)),) | ||
-include $(CC_DEPS) | ||
endif | ||
ifneq ($(strip $(CPP_DEPS)),) | ||
-include $(CPP_DEPS) | ||
endif | ||
ifneq ($(strip $(CXX_DEPS)),) | ||
-include $(CXX_DEPS) | ||
endif | ||
ifneq ($(strip $(C_UPPER_DEPS)),) | ||
-include $(C_UPPER_DEPS) | ||
endif | ||
endif | ||
|
||
-include ../makefile.defs | ||
|
||
# Add inputs and outputs from these tool invocations to the build variables | ||
|
||
# All Target | ||
all: Server | ||
|
||
# Tool invocations | ||
Server: $(OBJS) $(USER_OBJS) | ||
@echo 'Building target: $@' | ||
@echo 'Invoking: GCC C++ Linker' | ||
g++ -o "Server" $(OBJS) $(USER_OBJS) $(LIBS) | ||
@echo 'Finished building target: $@' | ||
@echo ' ' | ||
|
||
# Other Targets | ||
clean: | ||
-$(RM) $(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) Server | ||
-@echo ' ' | ||
|
||
.PHONY: all clean dependents | ||
.SECONDARY: | ||
|
||
-include ../makefile.targets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
################################################################################ | ||
# Automatically-generated file. Do not edit! | ||
################################################################################ | ||
|
||
USER_OBJS := | ||
|
||
LIBS := -lpthread | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
################################################################################ | ||
# Automatically-generated file. Do not edit! | ||
################################################################################ | ||
|
||
O_SRCS := | ||
CPP_SRCS := | ||
C_UPPER_SRCS := | ||
C_SRCS := | ||
S_UPPER_SRCS := | ||
OBJ_SRCS := | ||
ASM_SRCS := | ||
CXX_SRCS := | ||
C++_SRCS := | ||
CC_SRCS := | ||
OBJS := | ||
C++_DEPS := | ||
C_DEPS := | ||
CC_DEPS := | ||
CPP_DEPS := | ||
EXECUTABLES := | ||
CXX_DEPS := | ||
C_UPPER_DEPS := | ||
|
||
# Every subdirectory with source files must be described here | ||
SUBDIRS := \ | ||
src \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
################################################################################ | ||
# Automatically-generated file. Do not edit! | ||
################################################################################ | ||
|
||
# Add inputs and outputs from these tool invocations to the build variables | ||
CPP_SRCS += \ | ||
../src/client.cc \ | ||
../src/network.cc \ | ||
../src/worker.cc | ||
|
||
CC_SRCS += \ | ||
../src/listenfd.cc \ | ||
../src/main.cc \ | ||
../src/main_event.cc \ | ||
../src/socket_util.cc \ | ||
../src/timers.cc | ||
|
||
OBJS += \ | ||
./src/client.o \ | ||
./src/listenfd.o \ | ||
./src/main.o \ | ||
./src/main_event.o \ | ||
./src/network.o \ | ||
./src/socket_util.o \ | ||
./src/timers.o \ | ||
./src/worker.o | ||
|
||
CC_DEPS += \ | ||
./src/listenfd.d \ | ||
./src/main.d \ | ||
./src/main_event.d \ | ||
./src/socket_util.d \ | ||
./src/timers.d | ||
|
||
CPP_DEPS += \ | ||
./src/client.d \ | ||
./src/network.d \ | ||
./src/worker.d | ||
|
||
|
||
# Each subdirectory must supply rules for building sources it contributes | ||
src/%.o: ../src/%.cc | ||
@echo 'Building file: $<' | ||
@echo 'Invoking: GCC C++ Compiler' | ||
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" | ||
@echo 'Finished building: $<' | ||
@echo ' ' | ||
|
||
src/%.o: ../src/%.cc | ||
@echo 'Building file: $<' | ||
@echo 'Invoking: GCC C++ Compiler' | ||
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" | ||
@echo 'Finished building: $<' | ||
@echo ' ' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
################################################################################ | ||
# Automatically-generated file. Do not edit! | ||
################################################################################ | ||
|
||
-include ../makefile.init | ||
|
||
RM := rm -rf | ||
|
||
# All of the sources participating in the build are defined here | ||
-include sources.mk | ||
-include src/subdir.mk | ||
-include subdir.mk | ||
-include objects.mk | ||
|
||
ifneq ($(MAKECMDGOALS),clean) | ||
ifneq ($(strip $(C++_DEPS)),) | ||
-include $(C++_DEPS) | ||
endif | ||
ifneq ($(strip $(C_DEPS)),) | ||
-include $(C_DEPS) | ||
endif | ||
ifneq ($(strip $(CC_DEPS)),) | ||
-include $(CC_DEPS) | ||
endif | ||
ifneq ($(strip $(CPP_DEPS)),) | ||
-include $(CPP_DEPS) | ||
endif | ||
ifneq ($(strip $(CXX_DEPS)),) | ||
-include $(CXX_DEPS) | ||
endif | ||
ifneq ($(strip $(C_UPPER_DEPS)),) | ||
-include $(C_UPPER_DEPS) | ||
endif | ||
endif | ||
|
||
-include ../makefile.defs | ||
|
||
# Add inputs and outputs from these tool invocations to the build variables | ||
|
||
# All Target | ||
all: Server | ||
|
||
# Tool invocations | ||
Server: $(OBJS) $(USER_OBJS) | ||
@echo 'Building target: $@' | ||
@echo 'Invoking: GCC C++ Linker' | ||
g++ -o "Server" $(OBJS) $(USER_OBJS) $(LIBS) | ||
@echo 'Finished building target: $@' | ||
@echo ' ' | ||
|
||
# Other Targets | ||
clean: | ||
-$(RM) $(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) Server | ||
-@echo ' ' | ||
|
||
.PHONY: all clean dependents | ||
.SECONDARY: | ||
|
||
-include ../makefile.targets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
################################################################################ | ||
# Automatically-generated file. Do not edit! | ||
################################################################################ | ||
|
||
USER_OBJS := | ||
|
||
LIBS := -lpthread | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
################################################################################ | ||
# Automatically-generated file. Do not edit! | ||
################################################################################ | ||
|
||
O_SRCS := | ||
CPP_SRCS := | ||
C_UPPER_SRCS := | ||
C_SRCS := | ||
S_UPPER_SRCS := | ||
OBJ_SRCS := | ||
ASM_SRCS := | ||
CXX_SRCS := | ||
C++_SRCS := | ||
CC_SRCS := | ||
OBJS := | ||
C++_DEPS := | ||
C_DEPS := | ||
CC_DEPS := | ||
CPP_DEPS := | ||
EXECUTABLES := | ||
CXX_DEPS := | ||
C_UPPER_DEPS := | ||
|
||
# Every subdirectory with source files must be described here | ||
SUBDIRS := \ | ||
src \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
################################################################################ | ||
# Automatically-generated file. Do not edit! | ||
################################################################################ | ||
|
||
# Add inputs and outputs from these tool invocations to the build variables | ||
CPP_SRCS += \ | ||
../src/client.cc \ | ||
../src/network.cc \ | ||
../src/worker.cc | ||
|
||
CC_SRCS += \ | ||
../src/listenfd.cc \ | ||
../src/main.cc \ | ||
../src/main_event.cc \ | ||
../src/socket_util.cc \ | ||
../src/timers.cc | ||
|
||
OBJS += \ | ||
./src/client.o \ | ||
./src/listenfd.o \ | ||
./src/main.o \ | ||
./src/main_event.o \ | ||
./src/network.o \ | ||
./src/socket_util.o \ | ||
./src/timers.o \ | ||
./src/worker.o | ||
|
||
CC_DEPS += \ | ||
./src/listenfd.d \ | ||
./src/main.d \ | ||
./src/main_event.d \ | ||
./src/socket_util.d \ | ||
./src/timers.d | ||
|
||
CPP_DEPS += \ | ||
./src/client.d \ | ||
./src/network.d \ | ||
./src/worker.d | ||
|
||
|
||
# Each subdirectory must supply rules for building sources it contributes | ||
src/%.o: ../src/%.cc | ||
@echo 'Building file: $<' | ||
@echo 'Invoking: GCC C++ Compiler' | ||
g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" | ||
@echo 'Finished building: $<' | ||
@echo ' ' | ||
|
||
src/%.o: ../src/%.cc | ||
@echo 'Building file: $<' | ||
@echo 'Invoking: GCC C++ Compiler' | ||
g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" | ||
@echo 'Finished building: $<' | ||
@echo ' ' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
|
||
设计很简单 支持 1M 的连接, 可以准时向客户端推送数据。 | ||
|
||
|
||
|
Empty file.
Oops, something went wrong.