Skip to content

Commit a01cf09

Browse files
committed
* made whole lib more robust
* started writing code documentation * added test for large data transfer * reformatted code, added .clang-format * no more sigpipe under *nix * added default arguments for client * added more comments * replaced bool with atomics for thread consistency * added RAII test
1 parent 55f888d commit a01cf09

19 files changed

+1372
-746
lines changed

.clang-format

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: LLVM
4+
AccessModifierOffset: -4
5+
AlignAfterOpenBracket: Align
6+
AlignConsecutiveMacros: None
7+
AlignConsecutiveAssignments: None
8+
AlignConsecutiveBitFields: None
9+
AlignConsecutiveDeclarations: None
10+
AlignEscapedNewlines: Right
11+
AlignOperands: Align
12+
AlignTrailingComments: true
13+
AllowAllArgumentsOnNextLine: true
14+
AllowAllConstructorInitializersOnNextLine: true
15+
AllowAllParametersOfDeclarationOnNextLine: true
16+
AllowShortEnumsOnASingleLine: true
17+
AllowShortBlocksOnASingleLine: Never
18+
AllowShortCaseLabelsOnASingleLine: false
19+
AllowShortFunctionsOnASingleLine: None
20+
AllowShortLambdasOnASingleLine: None
21+
AllowShortIfStatementsOnASingleLine: Never
22+
AllowShortLoopsOnASingleLine: false
23+
AlwaysBreakAfterDefinitionReturnType: None
24+
AlwaysBreakAfterReturnType: None
25+
AlwaysBreakBeforeMultilineStrings: false
26+
AlwaysBreakTemplateDeclarations: MultiLine
27+
AttributeMacros:
28+
- __capability
29+
BinPackArguments: true
30+
BinPackParameters: true
31+
BraceWrapping:
32+
AfterCaseLabel: false
33+
AfterClass: false
34+
AfterControlStatement: Never
35+
AfterEnum: false
36+
AfterFunction: true
37+
AfterNamespace: false
38+
AfterObjCDeclaration: false
39+
AfterStruct: false
40+
AfterUnion: false
41+
AfterExternBlock: false
42+
BeforeCatch: false
43+
BeforeElse: false
44+
BeforeLambdaBody: false
45+
BeforeWhile: false
46+
IndentBraces: false
47+
SplitEmptyFunction: true
48+
SplitEmptyRecord: true
49+
SplitEmptyNamespace: true
50+
BreakBeforeBinaryOperators: None
51+
BreakBeforeConceptDeclarations: true
52+
BreakBeforeBraces: Custom
53+
BreakBeforeInheritanceComma: false
54+
BreakInheritanceList: BeforeColon
55+
BreakBeforeTernaryOperators: true
56+
BreakConstructorInitializersBeforeComma: false
57+
BreakConstructorInitializers: BeforeColon
58+
BreakAfterJavaFieldAnnotations: false
59+
BreakStringLiterals: true
60+
ColumnLimit: 140
61+
CommentPragmas: '^ IWYU pragma:'
62+
CompactNamespaces: false
63+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
64+
ConstructorInitializerIndentWidth: 4
65+
ContinuationIndentWidth: 4
66+
Cpp11BracedListStyle: true
67+
DeriveLineEnding: true
68+
DerivePointerAlignment: false
69+
DisableFormat: false
70+
EmptyLineBeforeAccessModifier: LogicalBlock
71+
ExperimentalAutoDetectBinPacking: false
72+
FixNamespaceComments: true
73+
ForEachMacros:
74+
- foreach
75+
- Q_FOREACH
76+
- BOOST_FOREACH
77+
StatementAttributeLikeMacros:
78+
- Q_EMIT
79+
IncludeBlocks: Preserve
80+
IncludeCategories:
81+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
82+
Priority: 2
83+
SortPriority: 0
84+
CaseSensitive: false
85+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
86+
Priority: 3
87+
SortPriority: 0
88+
CaseSensitive: false
89+
- Regex: '.*'
90+
Priority: 1
91+
SortPriority: 0
92+
CaseSensitive: false
93+
IncludeIsMainRegex: '(Test)?$'
94+
IncludeIsMainSourceRegex: ''
95+
IndentCaseLabels: false
96+
IndentCaseBlocks: false
97+
IndentGotoLabels: true
98+
IndentPPDirectives: None
99+
IndentExternBlock: AfterExternBlock
100+
IndentRequires: false
101+
IndentWidth: 4
102+
IndentWrappedFunctionNames: false
103+
InsertTrailingCommas: None
104+
JavaScriptQuotes: Leave
105+
JavaScriptWrapImports: true
106+
KeepEmptyLinesAtTheStartOfBlocks: true
107+
MacroBlockBegin: ''
108+
MacroBlockEnd: ''
109+
MaxEmptyLinesToKeep: 1
110+
NamespaceIndentation: None
111+
ObjCBinPackProtocolList: Auto
112+
ObjCBlockIndentWidth: 2
113+
ObjCBreakBeforeNestedBlockParam: true
114+
ObjCSpaceAfterProperty: false
115+
ObjCSpaceBeforeProtocolList: true
116+
PenaltyBreakAssignment: 2
117+
PenaltyBreakBeforeFirstCallParameter: 19
118+
PenaltyBreakComment: 300
119+
PenaltyBreakFirstLessLess: 120
120+
PenaltyBreakString: 1000
121+
PenaltyBreakTemplateDeclaration: 10
122+
PenaltyExcessCharacter: 1000000
123+
PenaltyReturnTypeOnItsOwnLine: 60
124+
PenaltyIndentedWhitespace: 0
125+
PointerAlignment: Right
126+
ReflowComments: true
127+
SortIncludes: true
128+
SortJavaStaticImport: Before
129+
SortUsingDeclarations: true
130+
SpaceAfterCStyleCast: false
131+
SpaceAfterLogicalNot: false
132+
SpaceAfterTemplateKeyword: true
133+
SpaceBeforeAssignmentOperators: true
134+
SpaceBeforeCaseColon: false
135+
SpaceBeforeCpp11BracedList: false
136+
SpaceBeforeCtorInitializerColon: true
137+
SpaceBeforeInheritanceColon: true
138+
SpaceBeforeParens: ControlStatements
139+
SpaceAroundPointerQualifiers: Default
140+
SpaceBeforeRangeBasedForLoopColon: true
141+
SpaceInEmptyBlock: false
142+
SpaceInEmptyParentheses: false
143+
SpacesBeforeTrailingComments: 1
144+
SpacesInAngles: false
145+
SpacesInConditionalStatement: false
146+
SpacesInContainerLiterals: true
147+
SpacesInCStyleCastParentheses: false
148+
SpacesInParentheses: false
149+
SpacesInSquareBrackets: false
150+
SpaceBeforeSquareBrackets: false
151+
BitFieldColonSpacing: Both
152+
Standard: Latest
153+
StatementMacros:
154+
- Q_UNUSED
155+
- QT_REQUIRE_VERSION
156+
TabWidth: 4
157+
UseCRLF: false
158+
UseTab: Never
159+
WhitespaceSensitiveMacros:
160+
- STRINGIZE
161+
- PP_STRINGIZE
162+
- BOOST_PP_STRINGIZE
163+
- NS_SWIFT_NAME
164+
- CF_SWIFT_NAME
165+
...
166+

.github/workflows/test_matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: All platform build test
22

3-
on: [push]
3+
on: [ push ]
44

55
env:
66
BUILD_TYPE: Release

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ set(NETLIB_SRC
1818
src/server.hpp
1919
src/service_resolver.hpp
2020
src/endpoint_accessor.hpp
21-
src/thread_pool.hpp)
21+
src/thread_pool.hpp
22+
src/socket_operations.hpp)
2223

2324
option(BUILD_TESTS "Build tests" ON)
2425
option(BUILD_EXAMPLES "Build example programs" ON)

0 commit comments

Comments
 (0)