From 17adcd823e38c8971c87d8ee48a06ad83d6aced7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?shuxin=20=E3=80=80=E3=80=80zheng?= Date: Sat, 26 Sep 2020 23:14:11 +0800 Subject: [PATCH] add fiber demo for IOS --- acl.xcworkspace/contents.xcworkspacedata | 11 + lib_fiber/c/CMakeLists.txt | 8 +- lib_fiber/c/Makefile | 15 +- lib_fiber/fiber.xcodeproj/project.pbxproj | 39 +- .../fiber_server.xcodeproj/project.pbxproj | 525 ++++++++++++++++++ .../fiber_server/fiber_server/AppDelegate.h | 15 + .../fiber_server/fiber_server/AppDelegate.m | 41 ++ .../AppIcon.appiconset/Contents.json | 98 ++++ .../Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 46 ++ .../fiber_server/Base.lproj/Main.storyboard | 24 + .../fiber_server/fiber_server/FiberClient.cpp | 29 + .../fiber_server/fiber_server/FiberClient.hpp | 26 + .../fiber_server/fiber_server/FiberServer.cpp | 78 +++ .../fiber_server/fiber_server/FiberServer.hpp | 32 ++ .../fiber_server/fiber_server/FiberTest.h | 18 + .../fiber_server/fiber_server/FiberTest.mm | 20 + .../fiber_server/fiber_server/FiberThread.cpp | 26 + .../fiber_server/fiber_server/FiberThread.hpp | 16 + .../fiber_server/fiber_server/Info.plist | 64 +++ .../fiber_server/fiber_server/SceneDelegate.h | 16 + .../fiber_server/fiber_server/SceneDelegate.m | 58 ++ .../fiber_server/ViewController.h | 15 + .../fiber_server/ViewController.m | 26 + .../xcode/fiber_server/fiber_server/main.m | 19 + .../fiber_serverUITests/Info.plist | 22 + .../fiber_serverUITests/fiber_serverUITests.m | 48 ++ 27 files changed, 1330 insertions(+), 11 deletions(-) create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server.xcodeproj/project.pbxproj create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/AppDelegate.h create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/AppDelegate.m create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/Assets.xcassets/Contents.json create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/Base.lproj/LaunchScreen.storyboard create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/Base.lproj/Main.storyboard create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/FiberClient.cpp create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/FiberClient.hpp create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/FiberServer.cpp create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/FiberServer.hpp create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/FiberTest.h create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/FiberTest.mm create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/FiberThread.cpp create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/FiberThread.hpp create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/Info.plist create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/SceneDelegate.h create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/SceneDelegate.m create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/ViewController.h create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/ViewController.m create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_server/main.m create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_serverUITests/Info.plist create mode 100644 lib_fiber/samples/xcode/fiber_server/fiber_serverUITests/fiber_serverUITests.m diff --git a/acl.xcworkspace/contents.xcworkspacedata b/acl.xcworkspace/contents.xcworkspacedata index ca47689e2..4d54d3b5e 100644 --- a/acl.xcworkspace/contents.xcworkspacedata +++ b/acl.xcworkspace/contents.xcworkspacedata @@ -1,6 +1,17 @@ + + + + + + diff --git a/lib_fiber/c/CMakeLists.txt b/lib_fiber/c/CMakeLists.txt index 33688c38a..259e98c79 100644 --- a/lib_fiber/c/CMakeLists.txt +++ b/lib_fiber/c/CMakeLists.txt @@ -23,12 +23,14 @@ add_definitions( "-DACL_WRITEABLE_CHECK" "-Wno-long-long" "-Wuninitialized" - "-DUSE_JMP" +# "-DUSE_JMP" "-DUSE_FAST_RING" "-D_POSIX_PTHREAD_SEMANTICS" "-DACL_PREPARE_COMPILE" # "-Wno-invalid-source-encoding" "-Wstrict-prototypes" +# "-DUSE_JMP_DEF" + "-DUSE_BOOST_JMP" ) if (CMAKE_BUILD_TYPE STREQUAL "") @@ -73,8 +75,12 @@ set(sources foreach(iter ${sources}) aux_source_directory(${iter} lib_src) + message(STATUS ">>add dir "${iter}) endforeach() +list(APPEND lib_src ${src}/fiber/boost/make_gas.S + ${src}/fiber/boost/jump_gas.S) + if(NOT CMAKE_SYSTEM_NAME MATCHES "ANDROID") set(lib_output_path ${PROJECT_BINARY_DIR}/lib) diff --git a/lib_fiber/c/Makefile b/lib_fiber/c/Makefile index b752e79f8..74a385bac 100644 --- a/lib_fiber/c/Makefile +++ b/lib_fiber/c/Makefile @@ -11,18 +11,19 @@ CFLAGS = -c -g -W \ -std=gnu99 \ -fPIC \ -Wall \ --Waggregate-return \ -Wpointer-arith \ -Wshadow \ -D_REENTRANT \ -D_POSIX_PTHREAD_SEMANTICS \ -D_USE_FAST_MACRO \ -Wno-long-long \ --DUSE_JMP \ -Wmissing-prototypes \ -Wcast-qual \ -DUSE_FAST_RING \ +-DUSE_JMP_DEF \ +#-DUSE_BOOST_JMP \ #-DUSE_FAST_TIME \ +#-Waggregate-return \ #-DDEBUG_MEM \ #-DUSE_VALGRIND \ #-I/usr/local/include @@ -147,7 +148,9 @@ SRC = $(wildcard $(SRC_PATH_SRC)/*.c) \ $(wildcard $(SRC_PATH_SRC)/event/*.c) \ $(wildcard $(SRC_PATH_SRC)/hook/*.c) -OBJ = $(patsubst %.c, $(OBJ_PATH_DST)/%.o, $(notdir $(SRC))) +#ASM_OBJ=$(OBJ_PATH_DST)/setjmp.o $(OBJ_PATH_DST)/make_gas.o $(OBJ_PATH_DST)/jump_gas.o +ASM_OBJ=$(OBJ_PATH_DST)/make_gas.o $(OBJ_PATH_DST)/jump_gas.o +OBJ = $(patsubst %.c, $(OBJ_PATH_DST)/%.o, $(notdir $(SRC))) $(ASM_OBJ) ########################################################### @@ -211,6 +214,12 @@ $(OBJ_PATH_DST)/%.o: $(SRC_PATH_SRC)/dns/%.c $(COMPILE) $< -o $@ $(OBJ_PATH_DST)/%.o: $(SRC_PATH_SRC)/fiber/%.c $(COMPILE) $< -o $@ +#$(OBJ_PATH_DST)/setjmp.o: $(SRC_PATH_SRC)/fiber/exp/setjmp.S +# $(COMPILE) $< -o $@ +$(OBJ_PATH_DST)/make_gas.o: $(SRC_PATH_SRC)/fiber/boost/make_gas.S + $(COMPILE) $< -o $@ +$(OBJ_PATH_DST)/jump_gas.o: $(SRC_PATH_SRC)/fiber/boost/jump_gas.S + $(COMPILE) $< -o $@ $(OBJ_PATH_DST)/%.o: $(SRC_PATH_SRC)/event/%.c $(COMPILE) $< -o $@ $(OBJ_PATH_DST)/%.o: $(SRC_PATH_SRC)/hook/%.c diff --git a/lib_fiber/fiber.xcodeproj/project.pbxproj b/lib_fiber/fiber.xcodeproj/project.pbxproj index d75813fbd..db919a230 100644 --- a/lib_fiber/fiber.xcodeproj/project.pbxproj +++ b/lib_fiber/fiber.xcodeproj/project.pbxproj @@ -96,6 +96,11 @@ 07BED4CC21BA270A0060BBE4 /* fiber_cond.c in Sources */ = {isa = PBXBuildFile; fileRef = 07BED4CB21BA270A0060BBE4 /* fiber_cond.c */; }; 07BED4CE21BA271F0060BBE4 /* fbase_event.c in Sources */ = {isa = PBXBuildFile; fileRef = 07BED4CD21BA271F0060BBE4 /* fbase_event.c */; }; 07BED4D021BA27530060BBE4 /* fiber_cond.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BED4CF21BA27530060BBE4 /* fiber_cond.h */; }; + 70753A3D251F8F67005B6E56 /* unix_jmp.h in Headers */ = {isa = PBXBuildFile; fileRef = 70753A3A251F8F67005B6E56 /* unix_jmp.h */; }; + 70753A3E251F8F67005B6E56 /* boost_jmp.h in Headers */ = {isa = PBXBuildFile; fileRef = 70753A3B251F8F67005B6E56 /* boost_jmp.h */; }; + 70753A3F251F8F67005B6E56 /* exp_jmp.h in Headers */ = {isa = PBXBuildFile; fileRef = 70753A3C251F8F67005B6E56 /* exp_jmp.h */; }; + 70753B03251F91E9005B6E56 /* jump_gas.S in Sources */ = {isa = PBXBuildFile; fileRef = 70753B01251F91E9005B6E56 /* jump_gas.S */; }; + 70753B04251F91E9005B6E56 /* make_gas.S in Sources */ = {isa = PBXBuildFile; fileRef = 70753B02251F91E9005B6E56 /* make_gas.S */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -189,6 +194,11 @@ 07BED4CB21BA270A0060BBE4 /* fiber_cond.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = fiber_cond.c; path = c/src/fiber_cond.c; sourceTree = ""; }; 07BED4CD21BA271F0060BBE4 /* fbase_event.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = fbase_event.c; path = c/src/fbase_event.c; sourceTree = ""; }; 07BED4CF21BA27530060BBE4 /* fiber_cond.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fiber_cond.h; path = c/include/fiber/fiber_cond.h; sourceTree = ""; }; + 70753A3A251F8F67005B6E56 /* unix_jmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unix_jmp.h; sourceTree = ""; }; + 70753A3B251F8F67005B6E56 /* boost_jmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = boost_jmp.h; sourceTree = ""; }; + 70753A3C251F8F67005B6E56 /* exp_jmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exp_jmp.h; sourceTree = ""; }; + 70753B01251F91E9005B6E56 /* jump_gas.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = jump_gas.S; path = boost/jump_gas.S; sourceTree = ""; }; + 70753B02251F91E9005B6E56 /* make_gas.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = make_gas.S; path = boost/make_gas.S; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -334,6 +344,10 @@ 070F35772090225C00672EDC /* fiber */ = { isa = PBXGroup; children = ( + 70753B00251F91C2005B6E56 /* boost */, + 70753A3B251F8F67005B6E56 /* boost_jmp.h */, + 70753A3C251F8F67005B6E56 /* exp_jmp.h */, + 70753A3A251F8F67005B6E56 /* unix_jmp.h */, 070F35782090225C00672EDC /* fiber_unix.c */, 070F35792090225C00672EDC /* fiber_win.c */, ); @@ -375,6 +389,15 @@ name = fiber; sourceTree = ""; }; + 70753B00251F91C2005B6E56 /* boost */ = { + isa = PBXGroup; + children = ( + 70753B01251F91E9005B6E56 /* jump_gas.S */, + 70753B02251F91E9005B6E56 /* make_gas.S */, + ); + name = boost; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -394,6 +417,7 @@ 070F35B12090225C00672EDC /* define.h in Headers */, 070F35A72090225C00672EDC /* pthread_patch.h in Headers */, 070F35992090225C00672EDC /* gettimeofday.h in Headers */, + 70753A3E251F8F67005B6E56 /* boost_jmp.h in Headers */, 070F35A32090225C00672EDC /* msg.h in Headers */, 07BED4D021BA27530060BBE4 /* fiber_cond.h in Headers */, 070F35A92090225C00672EDC /* ring.h in Headers */, @@ -411,10 +435,12 @@ 070F35BD2090225C00672EDC /* event_kqueue.h in Headers */, 070F35BB2090225C00672EDC /* event_iocp.h in Headers */, 070F35C12090225C00672EDC /* event_select.h in Headers */, + 70753A3D251F8F67005B6E56 /* unix_jmp.h in Headers */, 070F35B52090225C00672EDC /* sane_inet.h in Headers */, 070F35322090220400672EDC /* fiber_base.h in Headers */, 070F35AB2090225C00672EDC /* sane_socket.h in Headers */, 070F35BF2090225C00672EDC /* event_poll.h in Headers */, + 70753A3F251F8F67005B6E56 /* exp_jmp.h in Headers */, 070F35332090220400672EDC /* fiber_channel.h in Headers */, 070F353A2090220400672EDC /* libfiber.h in Headers */, 070F35B02090225C00672EDC /* common.h in Headers */, @@ -531,6 +557,8 @@ 070F35952090225C00672EDC /* doze.c in Sources */, 070F35CE2090225C00672EDC /* file_event.c in Sources */, 070F35CC2090225C00672EDC /* fiber.c in Sources */, + 70753B03251F91E9005B6E56 /* jump_gas.S in Sources */, + 70753B04251F91E9005B6E56 /* make_gas.S in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -574,7 +602,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", - "$(inherited)", + USE_BOOST_JMP, ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -624,6 +652,7 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = USE_BOOST_JMP; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; @@ -641,11 +670,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; EXECUTABLE_PREFIX = lib; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - USE_JMP, - ); + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited) "; HEADER_SEARCH_PATHS = ( ../lib_fiber/c/include, ../lib_fiber/c/src, @@ -673,7 +698,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; EXECUTABLE_PREFIX = lib; - GCC_PREPROCESSOR_DEFINITIONS = USE_JMP; + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited) "; HEADER_SEARCH_PATHS = ( ../lib_fiber/c/include, ../lib_fiber/c/src, diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server.xcodeproj/project.pbxproj b/lib_fiber/samples/xcode/fiber_server/fiber_server.xcodeproj/project.pbxproj new file mode 100644 index 000000000..f81a2207d --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server.xcodeproj/project.pbxproj @@ -0,0 +1,525 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 707539FB251E4AB0005B6E56 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 707539FA251E4AB0005B6E56 /* AppDelegate.m */; }; + 707539FE251E4AB0005B6E56 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 707539FD251E4AB0005B6E56 /* SceneDelegate.m */; }; + 70753A01251E4AB0005B6E56 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 70753A00251E4AB0005B6E56 /* ViewController.m */; }; + 70753A04251E4AB0005B6E56 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 70753A02251E4AB0005B6E56 /* Main.storyboard */; }; + 70753A06251E4AB4005B6E56 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 70753A05251E4AB4005B6E56 /* Assets.xcassets */; }; + 70753A09251E4AB4005B6E56 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 70753A07251E4AB4005B6E56 /* LaunchScreen.storyboard */; }; + 70753A0C251E4AB4005B6E56 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 70753A0B251E4AB4005B6E56 /* main.m */; }; + 70753A16251E4AB4005B6E56 /* fiber_serverUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 70753A15251E4AB4005B6E56 /* fiber_serverUITests.m */; }; + 70753A28251ECE7E005B6E56 /* FiberServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 70753A26251ECE7E005B6E56 /* FiberServer.cpp */; }; + 70753A2B251ED051005B6E56 /* FiberClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 70753A29251ED051005B6E56 /* FiberClient.cpp */; }; + 70753A36251ED92C005B6E56 /* FiberThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 70753A34251ED92C005B6E56 /* FiberThread.cpp */; }; + 70753A38251EDC5B005B6E56 /* FiberTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 70753A37251EDC5B005B6E56 /* FiberTest.mm */; }; + 70753AF7251F9116005B6E56 /* libfiber.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70753AF6251F9116005B6E56 /* libfiber.a */; }; + 70753AF9251F9116005B6E56 /* libfiber_cpp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70753AF8251F9116005B6E56 /* libfiber_cpp.a */; }; + 70753AFB251F914D005B6E56 /* libacl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70753AFA251F914D005B6E56 /* libacl.a */; }; + 70753AFD251F914D005B6E56 /* libacl_cpp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70753AFC251F914D005B6E56 /* libacl_cpp.a */; }; + 70753AFF251F914D005B6E56 /* libprotocol.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70753AFE251F914D005B6E56 /* libprotocol.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 70753A12251E4AB4005B6E56 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 707539EE251E4AB0005B6E56 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 707539F5251E4AB0005B6E56; + remoteInfo = fiber_server; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 707539F6251E4AB0005B6E56 /* fiber_server.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = fiber_server.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 707539F9251E4AB0005B6E56 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 707539FA251E4AB0005B6E56 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 707539FC251E4AB0005B6E56 /* SceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneDelegate.h; sourceTree = ""; }; + 707539FD251E4AB0005B6E56 /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SceneDelegate.m; sourceTree = ""; }; + 707539FF251E4AB0005B6E56 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 70753A00251E4AB0005B6E56 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 70753A03251E4AB0005B6E56 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 70753A05251E4AB4005B6E56 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 70753A08251E4AB4005B6E56 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 70753A0A251E4AB4005B6E56 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 70753A0B251E4AB4005B6E56 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 70753A11251E4AB4005B6E56 /* fiber_serverUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = fiber_serverUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 70753A15251E4AB4005B6E56 /* fiber_serverUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = fiber_serverUITests.m; sourceTree = ""; }; + 70753A17251E4AB4005B6E56 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 70753A26251ECE7E005B6E56 /* FiberServer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FiberServer.cpp; sourceTree = ""; }; + 70753A27251ECE7E005B6E56 /* FiberServer.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = FiberServer.hpp; sourceTree = ""; }; + 70753A29251ED051005B6E56 /* FiberClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FiberClient.cpp; sourceTree = ""; }; + 70753A2A251ED051005B6E56 /* FiberClient.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = FiberClient.hpp; sourceTree = ""; }; + 70753A2D251ED514005B6E56 /* libfiber.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libfiber.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 70753A2F251ED514005B6E56 /* libfiber_cpp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libfiber_cpp.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 70753A34251ED92C005B6E56 /* FiberThread.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FiberThread.cpp; sourceTree = ""; }; + 70753A35251ED92C005B6E56 /* FiberThread.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = FiberThread.hpp; sourceTree = ""; }; + 70753A37251EDC5B005B6E56 /* FiberTest.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FiberTest.mm; sourceTree = ""; }; + 70753A39251EDC87005B6E56 /* FiberTest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FiberTest.h; sourceTree = ""; }; + 70753AF6251F9116005B6E56 /* libfiber.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libfiber.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 70753AF8251F9116005B6E56 /* libfiber_cpp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libfiber_cpp.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 70753AFA251F914D005B6E56 /* libacl.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libacl.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 70753AFC251F914D005B6E56 /* libacl_cpp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libacl_cpp.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 70753AFE251F914D005B6E56 /* libprotocol.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libprotocol.a; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 707539F3251E4AB0005B6E56 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 70753AFB251F914D005B6E56 /* libacl.a in Frameworks */, + 70753AFD251F914D005B6E56 /* libacl_cpp.a in Frameworks */, + 70753AFF251F914D005B6E56 /* libprotocol.a in Frameworks */, + 70753AF7251F9116005B6E56 /* libfiber.a in Frameworks */, + 70753AF9251F9116005B6E56 /* libfiber_cpp.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 70753A0E251E4AB4005B6E56 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 707539ED251E4AB0005B6E56 = { + isa = PBXGroup; + children = ( + 707539F8251E4AB0005B6E56 /* fiber_server */, + 70753A14251E4AB4005B6E56 /* fiber_serverUITests */, + 707539F7251E4AB0005B6E56 /* Products */, + 70753A2C251ED514005B6E56 /* Frameworks */, + ); + sourceTree = ""; + }; + 707539F7251E4AB0005B6E56 /* Products */ = { + isa = PBXGroup; + children = ( + 707539F6251E4AB0005B6E56 /* fiber_server.app */, + 70753A11251E4AB4005B6E56 /* fiber_serverUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 707539F8251E4AB0005B6E56 /* fiber_server */ = { + isa = PBXGroup; + children = ( + 707539F9251E4AB0005B6E56 /* AppDelegate.h */, + 707539FA251E4AB0005B6E56 /* AppDelegate.m */, + 707539FC251E4AB0005B6E56 /* SceneDelegate.h */, + 707539FD251E4AB0005B6E56 /* SceneDelegate.m */, + 707539FF251E4AB0005B6E56 /* ViewController.h */, + 70753A00251E4AB0005B6E56 /* ViewController.m */, + 70753A02251E4AB0005B6E56 /* Main.storyboard */, + 70753A05251E4AB4005B6E56 /* Assets.xcassets */, + 70753A07251E4AB4005B6E56 /* LaunchScreen.storyboard */, + 70753A0A251E4AB4005B6E56 /* Info.plist */, + 70753A0B251E4AB4005B6E56 /* main.m */, + 70753A26251ECE7E005B6E56 /* FiberServer.cpp */, + 70753A27251ECE7E005B6E56 /* FiberServer.hpp */, + 70753A29251ED051005B6E56 /* FiberClient.cpp */, + 70753A2A251ED051005B6E56 /* FiberClient.hpp */, + 70753A34251ED92C005B6E56 /* FiberThread.cpp */, + 70753A35251ED92C005B6E56 /* FiberThread.hpp */, + 70753A37251EDC5B005B6E56 /* FiberTest.mm */, + 70753A39251EDC87005B6E56 /* FiberTest.h */, + ); + path = fiber_server; + sourceTree = ""; + }; + 70753A14251E4AB4005B6E56 /* fiber_serverUITests */ = { + isa = PBXGroup; + children = ( + 70753A15251E4AB4005B6E56 /* fiber_serverUITests.m */, + 70753A17251E4AB4005B6E56 /* Info.plist */, + ); + path = fiber_serverUITests; + sourceTree = ""; + }; + 70753A2C251ED514005B6E56 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 70753AFA251F914D005B6E56 /* libacl.a */, + 70753AFC251F914D005B6E56 /* libacl_cpp.a */, + 70753AFE251F914D005B6E56 /* libprotocol.a */, + 70753AF6251F9116005B6E56 /* libfiber.a */, + 70753AF8251F9116005B6E56 /* libfiber_cpp.a */, + 70753A2D251ED514005B6E56 /* libfiber.a */, + 70753A2F251ED514005B6E56 /* libfiber_cpp.a */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 707539F5251E4AB0005B6E56 /* fiber_server */ = { + isa = PBXNativeTarget; + buildConfigurationList = 70753A1A251E4AB4005B6E56 /* Build configuration list for PBXNativeTarget "fiber_server" */; + buildPhases = ( + 707539F2251E4AB0005B6E56 /* Sources */, + 707539F3251E4AB0005B6E56 /* Frameworks */, + 707539F4251E4AB0005B6E56 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = fiber_server; + productName = fiber_server; + productReference = 707539F6251E4AB0005B6E56 /* fiber_server.app */; + productType = "com.apple.product-type.application"; + }; + 70753A10251E4AB4005B6E56 /* fiber_serverUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 70753A1D251E4AB4005B6E56 /* Build configuration list for PBXNativeTarget "fiber_serverUITests" */; + buildPhases = ( + 70753A0D251E4AB4005B6E56 /* Sources */, + 70753A0E251E4AB4005B6E56 /* Frameworks */, + 70753A0F251E4AB4005B6E56 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 70753A13251E4AB4005B6E56 /* PBXTargetDependency */, + ); + name = fiber_serverUITests; + productName = fiber_serverUITests; + productReference = 70753A11251E4AB4005B6E56 /* fiber_serverUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 707539EE251E4AB0005B6E56 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1170; + ORGANIZATIONNAME = acl; + TargetAttributes = { + 707539F5251E4AB0005B6E56 = { + CreatedOnToolsVersion = 11.7; + }; + 70753A10251E4AB4005B6E56 = { + CreatedOnToolsVersion = 11.7; + TestTargetID = 707539F5251E4AB0005B6E56; + }; + }; + }; + buildConfigurationList = 707539F1251E4AB0005B6E56 /* Build configuration list for PBXProject "fiber_server" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 707539ED251E4AB0005B6E56; + productRefGroup = 707539F7251E4AB0005B6E56 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 707539F5251E4AB0005B6E56 /* fiber_server */, + 70753A10251E4AB4005B6E56 /* fiber_serverUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 707539F4251E4AB0005B6E56 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 70753A09251E4AB4005B6E56 /* LaunchScreen.storyboard in Resources */, + 70753A06251E4AB4005B6E56 /* Assets.xcassets in Resources */, + 70753A04251E4AB0005B6E56 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 70753A0F251E4AB4005B6E56 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 707539F2251E4AB0005B6E56 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 70753A01251E4AB0005B6E56 /* ViewController.m in Sources */, + 707539FB251E4AB0005B6E56 /* AppDelegate.m in Sources */, + 70753A36251ED92C005B6E56 /* FiberThread.cpp in Sources */, + 70753A28251ECE7E005B6E56 /* FiberServer.cpp in Sources */, + 70753A2B251ED051005B6E56 /* FiberClient.cpp in Sources */, + 70753A0C251E4AB4005B6E56 /* main.m in Sources */, + 70753A38251EDC5B005B6E56 /* FiberTest.mm in Sources */, + 707539FE251E4AB0005B6E56 /* SceneDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 70753A0D251E4AB4005B6E56 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 70753A16251E4AB4005B6E56 /* fiber_serverUITests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 70753A13251E4AB4005B6E56 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 707539F5251E4AB0005B6E56 /* fiber_server */; + targetProxy = 70753A12251E4AB4005B6E56 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 70753A02251E4AB0005B6E56 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 70753A03251E4AB0005B6E56 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 70753A07251E4AB4005B6E56 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 70753A08251E4AB4005B6E56 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 70753A18251E4AB4005B6E56 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ../../../cpp/include; + IPHONEOS_DEPLOYMENT_TARGET = 13.7; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 70753A19251E4AB4005B6E56 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ../../../cpp/include; + IPHONEOS_DEPLOYMENT_TARGET = 13.7; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 70753A1B251E4AB4005B6E56 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + HEADER_SEARCH_PATHS = "$(inherited)"; + INFOPLIST_FILE = fiber_server/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "acl.fiber-server"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 70753A1C251E4AB4005B6E56 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + HEADER_SEARCH_PATHS = "$(inherited)"; + INFOPLIST_FILE = fiber_server/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "acl.fiber-server"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 70753A1E251E4AB4005B6E56 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = fiber_serverUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "acl.fiber-serverUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = fiber_server; + }; + name = Debug; + }; + 70753A1F251E4AB4005B6E56 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = fiber_serverUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "acl.fiber-serverUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = fiber_server; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 707539F1251E4AB0005B6E56 /* Build configuration list for PBXProject "fiber_server" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 70753A18251E4AB4005B6E56 /* Debug */, + 70753A19251E4AB4005B6E56 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 70753A1A251E4AB4005B6E56 /* Build configuration list for PBXNativeTarget "fiber_server" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 70753A1B251E4AB4005B6E56 /* Debug */, + 70753A1C251E4AB4005B6E56 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 70753A1D251E4AB4005B6E56 /* Build configuration list for PBXNativeTarget "fiber_serverUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 70753A1E251E4AB4005B6E56 /* Debug */, + 70753A1F251E4AB4005B6E56 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 707539EE251E4AB0005B6E56 /* Project object */; +} diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/AppDelegate.h b/lib_fiber/samples/xcode/fiber_server/fiber_server/AppDelegate.h new file mode 100644 index 000000000..80afc90d2 --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// fiber_server +// +// Created by shuxin   zheng on 2020/9/25. +// Copyright © 2020 acl. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + + +@end + diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/AppDelegate.m b/lib_fiber/samples/xcode/fiber_server/fiber_server/AppDelegate.m new file mode 100644 index 000000000..c492c937c --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/AppDelegate.m @@ -0,0 +1,41 @@ +// +// AppDelegate.m +// fiber_server +// +// Created by shuxin   zheng on 2020/9/25. +// Copyright © 2020 acl. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +#pragma mark - UISceneSession lifecycle + + +- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; +} + + +- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. +} + + +@end diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/Assets.xcassets/AppIcon.appiconset/Contents.json b/lib_fiber/samples/xcode/fiber_server/fiber_server/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..9221b9bb1 --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/Assets.xcassets/Contents.json b/lib_fiber/samples/xcode/fiber_server/fiber_server/Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/Base.lproj/LaunchScreen.storyboard b/lib_fiber/samples/xcode/fiber_server/fiber_server/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..2c6e53e8c --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/Base.lproj/Main.storyboard b/lib_fiber/samples/xcode/fiber_server/fiber_server/Base.lproj/Main.storyboard new file mode 100644 index 000000000..808a21ce7 --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberClient.cpp b/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberClient.cpp new file mode 100644 index 000000000..5ecff29a0 --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberClient.cpp @@ -0,0 +1,29 @@ +// +// FiberClient.cpp +// fiber_server +// +// Created by shuxin   zheng on 2020/9/26. +// Copyright © 2020 acl. All rights reserved. +// + +#include +#include +#include "fiber/libfiber.hpp" +#include "FiberClient.hpp" + +void FiberClient::run(void) { + printf("FiberClient run, fd=%d\r\n", fd_); + char buf[8192]; + while (true) { + ssize_t ret = read(fd_, buf, sizeof(buf)); + if (ret <= 0) { + break; + } + if (write(fd_, buf, ret) <= 0) { + break; + } + } + printf("Close client fd=%d\r\n", fd_); + close(fd_); + delete this; +} diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberClient.hpp b/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberClient.hpp new file mode 100644 index 000000000..797fac67b --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberClient.hpp @@ -0,0 +1,26 @@ +// +// FiberClient.hpp +// fiber_server +// +// Created by shuxin   zheng on 2020/9/26. +// Copyright © 2020 acl. All rights reserved. +// + +#ifndef FiberClient_hpp +#define FiberClient_hpp + +class FiberClient : public acl::fiber { +public: + FiberClient(int fd) : fd_(fd) {} + +protected: + // @override + void run(void); + + ~FiberClient(void) {} + +private: + int fd_; +}; + +#endif /* FiberClient_hpp */ diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberServer.cpp b/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberServer.cpp new file mode 100644 index 000000000..57c324bb6 --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberServer.cpp @@ -0,0 +1,78 @@ +// +// FiberServer.cpp +// fiber_server +// +// Created by shuxin   zheng on 2020/9/26. +// Copyright © 2020 acl. All rights reserved. +// + +#include +#include +#include +#include "fiber/libfiber.hpp" +#include "FiberClient.hpp" +#include "FiberServer.hpp" + +FiberServer::FiberServer(const char* ip, int port) +: ip_(ip), port_(port), lfd_(-1) {} + +int FiberServer::BindAndrListen(const char *ip, int port) { + int fd; + int on; + struct sockaddr_in sa; + + memset(&sa, 0, sizeof(sa)); + sa.sin_family = AF_INET; + sa.sin_port = htons(port); + sa.sin_addr.s_addr = inet_addr(ip); + + fd = socket(AF_INET, SOCK_STREAM, 0); + if (fd == -1) { + printf("create socket error, %s\r\n", acl::fiber::last_serror()); + return -1; + } + + if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on))) { + printf("setsockopt error %s\r\n", acl::fiber::last_serror()); + close(fd); + return -1; + } + + if (bind(fd, (struct sockaddr *) &sa, sizeof(struct sockaddr)) < 0) { + printf("bind error %s\r\n", acl::fiber::last_serror()); + close(fd); + return -1; + } + + if (listen(fd, 1024) < 0) { + printf("listen error %s\r\n", acl::fiber::last_serror()); + close(fd); + return -1; + } + + return fd; +} + +void FiberServer::run(void) { + lfd_ = BindAndrListen(ip_.c_str(), port_); + if (lfd_ == -1) { + return; + } + + printf("listen %s:%d ok\r\n", ip_.c_str(), port_); + + while (true) { + struct sockaddr_in sa; + size_t len = sizeof(sa); + int fd = accept(lfd_, (struct sockaddr *)& sa, (socklen_t *)& len); + if (fd == -1) { + printf("accept error\r\n"); + break; + } + printf("Accept on fd=%d\r\n", fd); + FiberClient* fb = new FiberClient(fd); + fb->start(); + } + close(lfd_); + delete this; +} diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberServer.hpp b/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberServer.hpp new file mode 100644 index 000000000..d17773285 --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberServer.hpp @@ -0,0 +1,32 @@ +// +// FiberServer.hpp +// fiber_server +// +// Created by shuxin   zheng on 2020/9/26. +// Copyright © 2020 acl. All rights reserved. +// + +#ifndef FiberServer_hpp +#define FiberServer_hpp + +#include + +class FiberServer : public acl::fiber { +public: + FiberServer(const char* ip, int port); + +protected: + // @override + void run(void); + + ~FiberServer(void) {} + +private: + std::string ip_; + int port_; + int lfd_; + + int BindAndrListen(const char *ip, int port); +}; + +#endif /* FiberServer_hpp */ diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberTest.h b/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberTest.h new file mode 100644 index 000000000..aa826f94a --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberTest.h @@ -0,0 +1,18 @@ +// +// FiberTest.h +// fiber_server +// +// Created by shuxin   zheng on 2020/9/26. +// Copyright © 2020 acl. All rights reserved. +// + +#ifndef FiberTest_h +#define FiberTest_h + +@interface FiberTest : NSObject + +-(void) Start; + +@end + +#endif /* FiberTest_h */ diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberTest.mm b/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberTest.mm new file mode 100644 index 000000000..258558328 --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberTest.mm @@ -0,0 +1,20 @@ +// +// FiberTest.m +// fiber_server +// +// Created by shuxin   zheng on 2020/9/26. +// Copyright © 2020 acl. All rights reserved. +// + +#import +#include "FiberThread.hpp" +#include "FiberTest.h" + +@implementation FiberTest + +-(void) Start +{ + StartThread(); +} + +@end diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberThread.cpp b/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberThread.cpp new file mode 100644 index 000000000..39d6f19ca --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberThread.cpp @@ -0,0 +1,26 @@ +// +// FiberTest.cpp +// fiber_server +// +// Created by shuxin   zheng on 2020/9/26. +// Copyright © 2020 acl. All rights reserved. +// + +#include +#include "fiber/libfiber.hpp" +#include "FiberServer.hpp" +#include "FiberThread.hpp" + +static void ThreadRun(void) { + const char* ip = "127.0.0.1"; + int port = 8192; + FiberServer* fb = new FiberServer(ip, port); + fb->start(); + + acl::fiber::schedule(); +} + +void StartThread(void) { + std::thread* thread = new std::thread(ThreadRun); + thread->detach(); +} diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberThread.hpp b/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberThread.hpp new file mode 100644 index 000000000..af33d783b --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/FiberThread.hpp @@ -0,0 +1,16 @@ +// +// FiberTest.hpp +// fiber_server +// +// Created by shuxin   zheng on 2020/9/26. +// Copyright © 2020 acl. All rights reserved. +// + +#ifndef FiberTest_hpp +#define FiberTest_hpp + +#include + +void StartThread(void); + +#endif /* FiberTest_hpp */ diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/Info.plist b/lib_fiber/samples/xcode/fiber_server/fiber_server/Info.plist new file mode 100644 index 000000000..7b6037c25 --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/Info.plist @@ -0,0 +1,64 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + SceneDelegate + UISceneStoryboardFile + Main + + + + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/SceneDelegate.h b/lib_fiber/samples/xcode/fiber_server/fiber_server/SceneDelegate.h new file mode 100644 index 000000000..08c6f7fb3 --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/SceneDelegate.h @@ -0,0 +1,16 @@ +// +// SceneDelegate.h +// fiber_server +// +// Created by shuxin   zheng on 2020/9/25. +// Copyright © 2020 acl. All rights reserved. +// + +#import + +@interface SceneDelegate : UIResponder + +@property (strong, nonatomic) UIWindow * window; + +@end + diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/SceneDelegate.m b/lib_fiber/samples/xcode/fiber_server/fiber_server/SceneDelegate.m new file mode 100644 index 000000000..95a53a33a --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/SceneDelegate.m @@ -0,0 +1,58 @@ +// +// SceneDelegate.m +// fiber_server +// +// Created by shuxin   zheng on 2020/9/25. +// Copyright © 2020 acl. All rights reserved. +// + +#import "SceneDelegate.h" + +@interface SceneDelegate () + +@end + +@implementation SceneDelegate + + +- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). +} + + +- (void)sceneDidDisconnect:(UIScene *)scene { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). +} + + +- (void)sceneDidBecomeActive:(UIScene *)scene { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. +} + + +- (void)sceneWillResignActive:(UIScene *)scene { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). +} + + +- (void)sceneWillEnterForeground:(UIScene *)scene { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. +} + + +- (void)sceneDidEnterBackground:(UIScene *)scene { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. +} + + +@end diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/ViewController.h b/lib_fiber/samples/xcode/fiber_server/fiber_server/ViewController.h new file mode 100644 index 000000000..c42525dbe --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// fiber_server +// +// Created by shuxin   zheng on 2020/9/25. +// Copyright © 2020 acl. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/ViewController.m b/lib_fiber/samples/xcode/fiber_server/fiber_server/ViewController.m new file mode 100644 index 000000000..94fdd9752 --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/ViewController.m @@ -0,0 +1,26 @@ +// +// ViewController.m +// fiber_server +// +// Created by shuxin   zheng on 2020/9/25. +// Copyright © 2020 acl. All rights reserved. +// + +#import "ViewController.h" +#import "FiberTest.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + FiberTest *test = [[FiberTest alloc] init]; + [test Start]; +} + + +@end diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_server/main.m b/lib_fiber/samples/xcode/fiber_server/fiber_server/main.m new file mode 100644 index 000000000..9ef348e15 --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_server/main.m @@ -0,0 +1,19 @@ +// +// main.m +// fiber_server +// +// Created by shuxin   zheng on 2020/9/25. +// Copyright © 2020 acl. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + NSString * appDelegateClassName; + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); + } + return UIApplicationMain(argc, argv, nil, appDelegateClassName); +} diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_serverUITests/Info.plist b/lib_fiber/samples/xcode/fiber_server/fiber_serverUITests/Info.plist new file mode 100644 index 000000000..64d65ca49 --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_serverUITests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/lib_fiber/samples/xcode/fiber_server/fiber_serverUITests/fiber_serverUITests.m b/lib_fiber/samples/xcode/fiber_server/fiber_serverUITests/fiber_serverUITests.m new file mode 100644 index 000000000..4c31cbcb7 --- /dev/null +++ b/lib_fiber/samples/xcode/fiber_server/fiber_serverUITests/fiber_serverUITests.m @@ -0,0 +1,48 @@ +// +// fiber_serverUITests.m +// fiber_serverUITests +// +// Created by shuxin   zheng on 2020/9/25. +// Copyright © 2020 acl. All rights reserved. +// + +#import + +@interface fiber_serverUITests : XCTestCase + +@end + +@implementation fiber_serverUITests + +- (void)setUp { + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + self.continueAfterFailure = NO; + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. +} + +- (void)testExample { + // UI tests must launch the application that they test. + XCUIApplication *app = [[XCUIApplication alloc] init]; + [app launch]; + + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. +} + +- (void)testLaunchPerformance { + if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) { + // This measures how long it takes to launch your application. + [self measureWithMetrics:@[XCTOSSignpostMetric.applicationLaunchMetric] block:^{ + [[[XCUIApplication alloc] init] launch]; + }]; + } +} + +@end