└── WifiDemo ├── WifiDemo ├── CocoaAsyncSocket │ ├── Examples │ │ ├── GCD │ │ │ ├── EchoServer │ │ │ │ ├── English.lproj │ │ │ │ │ └── InfoPlist.strings │ │ │ │ ├── EchoServer_Prefix.pch │ │ │ │ ├── EchoServer.xcodeproj │ │ │ │ │ ├── project.xcworkspace │ │ │ │ │ │ └── contents.xcworkspacedata │ │ │ │ │ └── xcuserdata │ │ │ │ │ │ └── yuedongkui.xcuserdatad │ │ │ │ │ │ └── xcschemes │ │ │ │ │ │ └── EchoServer.xcscheme │ │ │ │ ├── main.m │ │ │ │ ├── EchoServerAppDelegate.h │ │ │ │ └── EchoServer-Info.plist │ │ │ ├── BonjourClient │ │ │ │ ├── English.lproj │ │ │ │ │ └── InfoPlist.strings │ │ │ │ ├── BonjourClient_Prefix.pch │ │ │ │ ├── BonjourClient.xcodeproj │ │ │ │ │ ├── project.xcworkspace │ │ │ │ │ │ └── contents.xcworkspacedata │ │ │ │ │ └── xcuserdata │ │ │ │ │ │ └── yuedongkui.xcuserdatad │ │ │ │ │ │ └── xcschemes │ │ │ │ │ │ └── BonjourClient.xcscheme │ │ │ │ ├── main.m │ │ │ │ ├── BonjourClientAppDelegate.h │ │ │ │ └── BonjourClient-Info.plist │ │ │ ├── BonjourServer │ │ │ │ ├── English.lproj │ │ │ │ │ └── InfoPlist.strings │ │ │ │ ├── BonjourServer_Prefix.pch │ │ │ │ ├── BonjourServer.xcodeproj │ │ │ │ │ ├── project.xcworkspace │ │ │ │ │ │ └── contents.xcworkspacedata │ │ │ │ │ └── xcuserdata │ │ │ │ │ │ └── yuedongkui.xcuserdatad │ │ │ │ │ │ └── xcschemes │ │ │ │ │ │ └── BonjourServer.xcscheme │ │ │ │ ├── main.m │ │ │ │ ├── BonjourServerAppDelegate.h │ │ │ │ ├── BonjourServer-Info.plist │ │ │ │ └── BonjourServerAppDelegate.m │ │ │ ├── ConnectTest │ │ │ │ ├── Mobile │ │ │ │ │ ├── ConnectTest │ │ │ │ │ │ ├── en.lproj │ │ │ │ │ │ │ └── InfoPlist.strings │ │ │ │ │ │ ├── ConnectTestViewController.m │ │ │ │ │ │ ├── ConnectTestViewController.h │ │ │ │ │ │ ├── main.m │ │ │ │ │ │ ├── ConnectTest-Prefix.pch │ │ │ │ │ │ ├── ConnectTestAppDelegate.h │ │ │ │ │ │ └── ConnectTest-Info.plist │ │ │ │ │ ├── Default-568h@2x.png │ │ │ │ │ └── ConnectTest.xcodeproj │ │ │ │ │ │ ├── project.xcworkspace │ │ │ │ │ │ └── contents.xcworkspacedata │ │ │ │ │ │ └── xcuserdata │ │ │ │ │ │ └── yuedongkui.xcuserdatad │ │ │ │ │ │ └── xcschemes │ │ │ │ │ │ └── ConnectTest.xcscheme │ │ │ │ ├── Desktop │ │ │ │ │ ├── ConnectTest │ │ │ │ │ │ ├── en.lproj │ │ │ │ │ │ │ ├── InfoPlist.strings │ │ │ │ │ │ │ └── Credits.rtf │ │ │ │ │ │ ├── ConnectTest-Prefix.pch │ │ │ │ │ │ ├── main.m │ │ │ │ │ │ ├── ConnectTestAppDelegate.h │ │ │ │ │ │ └── ConnectTest-Info.plist │ │ │ │ │ └── ConnectTest.xcodeproj │ │ │ │ │ │ ├── project.xcworkspace │ │ │ │ │ │ └── contents.xcworkspacedata │ │ │ │ │ │ └── xcuserdata │ │ │ │ │ │ └── yuedongkui.xcuserdatad │ │ │ │ │ │ └── xcschemes │ │ │ │ │ │ └── ConnectTest.xcscheme │ │ │ │ └── ReadMe.txt │ │ │ ├── TestPreBuffer │ │ │ │ ├── Desktop │ │ │ │ │ ├── TestPreBuffer │ │ │ │ │ │ ├── en.lproj │ │ │ │ │ │ │ ├── InfoPlist.strings │ │ │ │ │ │ │ └── Credits.rtf │ │ │ │ │ │ ├── AppDelegate.h │ │ │ │ │ │ ├── TestPreBuffer-Prefix.pch │ │ │ │ │ │ ├── AppDelegate.m │ │ │ │ │ │ ├── main.m │ │ │ │ │ │ └── TestPreBuffer-Info.plist │ │ │ │ │ └── TestPreBuffer.xcodeproj │ │ │ │ │ │ ├── project.xcworkspace │ │ │ │ │ │ └── contents.xcworkspacedata │ │ │ │ │ │ └── xcuserdata │ │ │ │ │ │ └── yuedongkui.xcuserdatad │ │ │ │ │ │ └── xcschemes │ │ │ │ │ │ └── TestPreBuffer.xcscheme │ │ │ │ ├── Mobile │ │ │ │ │ ├── TestPreBuffer │ │ │ │ │ │ ├── en.lproj │ │ │ │ │ │ │ └── InfoPlist.strings │ │ │ │ │ │ ├── AppDelegate.h │ │ │ │ │ │ ├── ViewController.h │ │ │ │ │ │ ├── TestPreBuffer-Prefix.pch │ │ │ │ │ │ ├── main.m │ │ │ │ │ │ ├── AppDelegate.m │ │ │ │ │ │ ├── ViewController.m │ │ │ │ │ │ └── TestPreBuffer-Info.plist │ │ │ │ │ ├── Default-568h@2x.png │ │ │ │ │ └── TestPreBuffer.xcodeproj │ │ │ │ │ │ ├── project.xcworkspace │ │ │ │ │ │ └── contents.xcworkspacedata │ │ │ │ │ │ └── xcuserdata │ │ │ │ │ │ └── yuedongkui.xcuserdatad │ │ │ │ │ │ └── xcschemes │ │ │ │ │ │ └── TestPreBuffer.xcscheme │ │ │ │ └── Shared │ │ │ │ │ └── TestPreBuffer.h │ │ │ ├── UdpEchoClient │ │ │ │ ├── Desktop │ │ │ │ │ ├── UdpEchoClient │ │ │ │ │ │ ├── en.lproj │ │ │ │ │ │ │ ├── InfoPlist.strings │ │ │ │ │ │ │ └── Credits.rtf │ │ │ │ │ │ ├── UdpEchoClient-Prefix.pch │ │ │ │ │ │ ├── main.m │ │ │ │ │ │ ├── AppDelegate.h │ │ │ │ │ │ └── UdpEchoClient-Info.plist │ │ │ │ │ └── UdpEchoClient.xcodeproj │ │ │ │ │ │ ├── project.xcworkspace │ │ │ │ │ │ └── contents.xcworkspacedata │ │ │ │ │ │ └── xcuserdata │ │ │ │ │ │ └── yuedongkui.xcuserdatad │ │ │ │ │ │ └── xcschemes │ │ │ │ │ │ └── UdpEchoClient.xcscheme │ │ │ │ └── Mobile │ │ │ │ │ ├── UdpEchoClient │ │ │ │ │ ├── en.lproj │ │ │ │ │ │ └── InfoPlist.strings │ │ │ │ │ ├── AppDelegate.h │ │ │ │ │ ├── ViewController.h │ │ │ │ │ ├── UdpEchoClient-Prefix.pch │ │ │ │ │ ├── main.m │ │ │ │ │ ├── UdpEchoClient-Info.plist │ │ │ │ │ └── AppDelegate.m │ │ │ │ │ ├── Default-568h@2x.png │ │ │ │ │ └── UdpEchoClient.xcodeproj │ │ │ │ │ ├── project.xcworkspace │ │ │ │ │ └── contents.xcworkspacedata │ │ │ │ │ └── xcuserdata │ │ │ │ │ └── yuedongkui.xcuserdatad │ │ │ │ │ └── xcschemes │ │ │ │ │ └── UdpEchoClient.xcscheme │ │ │ ├── UdpEchoServer │ │ │ │ ├── Desktop │ │ │ │ │ ├── UdpEchoServer │ │ │ │ │ │ ├── en.lproj │ │ │ │ │ │ │ ├── InfoPlist.strings │ │ │ │ │ │ │ └── Credits.rtf │ │ │ │ │ │ ├── UdpEchoServer-Prefix.pch │ │ │ │ │ │ ├── main.m │ │ │ │ │ │ ├── AppDelegate.h │ │ │ │ │ │ └── UdpEchoServer-Info.plist │ │ │ │ │ └── UdpEchoServer.xcodeproj │ │ │ │ │ │ ├── project.xcworkspace │ │ │ │ │ │ └── contents.xcworkspacedata │ │ │ │ │ │ └── xcuserdata │ │ │ │ │ │ └── yuedongkui.xcuserdatad │ │ │ │ │ │ └── xcschemes │ │ │ │ │ │ └── UdpEchoServer.xcscheme │ │ │ │ └── Mobile │ │ │ │ │ ├── UdpEchoServer │ │ │ │ │ ├── en.lproj │ │ │ │ │ │ └── InfoPlist.strings │ │ │ │ │ ├── AppDelegate.h │ │ │ │ │ ├── ViewController.h │ │ │ │ │ ├── UdpEchoServer-Prefix.pch │ │ │ │ │ ├── main.m │ │ │ │ │ ├── UdpEchoServer-Info.plist │ │ │ │ │ └── AppDelegate.m │ │ │ │ │ └── UdpEchoServer.xcodeproj │ │ │ │ │ ├── project.xcworkspace │ │ │ │ │ └── contents.xcworkspacedata │ │ │ │ │ └── xcuserdata │ │ │ │ │ └── yuedongkui.xcuserdatad │ │ │ │ │ └── xcschemes │ │ │ │ │ └── UdpEchoServer.xcscheme │ │ │ └── SimpleHTTPClient │ │ │ │ ├── Mobile │ │ │ │ ├── SimpleHTTPClient │ │ │ │ │ ├── en.lproj │ │ │ │ │ │ └── InfoPlist.strings │ │ │ │ │ ├── SimpleHTTPClientViewController.m │ │ │ │ │ ├── SimpleHTTPClientViewController.h │ │ │ │ │ ├── main.m │ │ │ │ │ ├── SimpleHTTPClient-Prefix.pch │ │ │ │ │ ├── SimpleHTTPClientAppDelegate.h │ │ │ │ │ └── SimpleHTTPClient-Info.plist │ │ │ │ ├── Default-568h@2x.png │ │ │ │ └── SimpleHTTPClient.xcodeproj │ │ │ │ │ ├── project.xcworkspace │ │ │ │ │ └── contents.xcworkspacedata │ │ │ │ │ └── xcuserdata │ │ │ │ │ └── yuedongkui.xcuserdatad │ │ │ │ │ └── xcschemes │ │ │ │ │ └── SimpleHTTPClient.xcscheme │ │ │ │ ├── Desktop │ │ │ │ ├── SimpleHTTPClient │ │ │ │ │ ├── en.lproj │ │ │ │ │ │ ├── InfoPlist.strings │ │ │ │ │ │ └── Credits.rtf │ │ │ │ │ ├── SimpleHTTPClient-Prefix.pch │ │ │ │ │ ├── main.m │ │ │ │ │ ├── SimpleHTTPClientAppDelegate.h │ │ │ │ │ └── SimpleHTTPClient-Info.plist │ │ │ │ └── SimpleHTTPClient.xcodeproj │ │ │ │ │ ├── project.xcworkspace │ │ │ │ │ └── contents.xcworkspacedata │ │ │ │ │ └── xcuserdata │ │ │ │ │ └── yuedongkui.xcuserdatad │ │ │ │ │ └── xcschemes │ │ │ │ │ └── SimpleHTTPClient.xcscheme │ │ │ │ └── ReadMe.txt │ │ └── RunLoop │ │ │ ├── UdpEchoClient │ │ │ ├── UdpEchoClient │ │ │ │ ├── en.lproj │ │ │ │ │ ├── InfoPlist.strings │ │ │ │ │ └── Credits.rtf │ │ │ │ ├── UdpEchoClient-Prefix.pch │ │ │ │ ├── main.m │ │ │ │ ├── AppDelegate.h │ │ │ │ └── UdpEchoClient-Info.plist │ │ │ └── UdpEchoClient.xcodeproj │ │ │ │ ├── project.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ │ │ └── xcuserdata │ │ │ │ └── yuedongkui.xcuserdatad │ │ │ │ └── xcschemes │ │ │ │ └── UdpEchoClient.xcscheme │ │ │ ├── UdpEchoServer │ │ │ ├── UdpEchoServer │ │ │ │ ├── en.lproj │ │ │ │ │ ├── InfoPlist.strings │ │ │ │ │ └── Credits.rtf │ │ │ │ ├── UdpEchoServer-Prefix.pch │ │ │ │ ├── main.m │ │ │ │ ├── AppDelegate.h │ │ │ │ └── UdpEchoServer-Info.plist │ │ │ └── UdpEchoServer.xcodeproj │ │ │ │ ├── project.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ │ │ └── xcuserdata │ │ │ │ └── yuedongkui.xcuserdatad │ │ │ │ └── xcschemes │ │ │ │ └── UdpEchoServer.xcscheme │ │ │ ├── InterfaceTest │ │ │ ├── Default-568h@2x.png │ │ │ ├── InterfaceTest_Prefix.pch │ │ │ ├── InterfaceTest.xcodeproj │ │ │ │ ├── project.xcworkspace │ │ │ │ │ └── contents.xcworkspacedata │ │ │ │ └── xcuserdata │ │ │ │ │ └── yuedongkui.xcuserdatad │ │ │ │ │ └── xcschemes │ │ │ │ │ └── InterfaceTest.xcscheme │ │ │ ├── Classes │ │ │ │ ├── InterfaceTestViewController.h │ │ │ │ ├── InterfaceTestAppDelegate.h │ │ │ │ └── InterfaceTestViewController.m │ │ │ ├── main.m │ │ │ ├── InterfaceTest-Info.plist │ │ │ └── Readme.txt │ │ │ └── EchoServer │ │ │ ├── English.lproj │ │ │ ├── InfoPlist.strings │ │ │ └── MainMenu.nib │ │ │ │ └── keyedobjects.nib │ │ │ ├── EchoServer_Prefix.pch │ │ │ ├── EchoServer.xcodeproj │ │ │ ├── project.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ │ └── xcuserdata │ │ │ │ └── yuedongkui.xcuserdatad │ │ │ │ └── xcschemes │ │ │ │ └── EchoServer.xcscheme │ │ │ ├── main.m │ │ │ ├── AppController.h │ │ │ ├── Instructions.txt │ │ │ └── Info.plist │ ├── CocoaAsyncSocket.xcodeproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── Tests │ │ ├── CocoaAsyncSocket.xcodeproj │ │ │ ├── project.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ ├── CocoaAsyncSocketTestsMac.xcscheme │ │ │ │ └── CocoaAsyncSocketTestsiOS.xcscheme │ │ ├── CocoaAsyncSocket.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── WorkspaceSettings.xcsettings │ │ ├── Podfile.lock │ │ ├── Podfile │ │ ├── Mac │ │ │ └── Info.plist │ │ ├── iOS │ │ │ └── Info.plist │ │ └── Shared │ │ │ └── GCDAsyncSocketConnectionTests.m │ ├── Source │ │ ├── Vendor │ │ │ └── CocoaLumberjack │ │ │ │ ├── Extensions │ │ │ │ ├── README.txt │ │ │ │ ├── DDMultiFormatter.h │ │ │ │ ├── DDContextFilterLogFormatter.h │ │ │ │ └── DDMultiFormatter.m │ │ │ │ ├── DDASLLogger.h │ │ │ │ ├── DDASLLogger.m │ │ │ │ └── DDAbstractDatabaseLogger.h │ │ ├── CocoaAsyncSocket.h │ │ ├── Info.plist │ │ ├── GCD │ │ │ └── Documentation.html │ │ └── RunLoop │ │ │ └── Documentation.html │ ├── .travis.yml │ └── CocoaAsyncSocket.podspec ├── AppDelegate.h ├── main.m ├── QRCode │ ├── DataMatrix.h │ ├── QREncoder.h │ └── DataMatrix.mm ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json └── Info.plist ├── WifiDemo.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── yuedongkui.xcuserdatad │ └── xcschemes │ ├── Wifi_Mac_Demo.xcscheme │ └── Wifi_iOS_Demo.xcscheme └── Wifi_iOS_Demo ├── ViewController.h ├── AppDelegate.h ├── NSString+IP.h ├── SocketViewController.h ├── main.m ├── AppDelegate.m ├── UIAlertView+Common.h ├── PrefixHeader.pch ├── Assets.xcassets └── AppIcon.appiconset │ └── Contents.json ├── Info.plist ├── UIAlertView+Common.m └── NSString+IP.m /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/EchoServer/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/BonjourClient/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/BonjourServer/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Mobile/ConnectTest/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Desktop/ConnectTest/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Desktop/TestPreBuffer/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Mobile/TestPreBuffer/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Desktop/UdpEchoClient/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Mobile/UdpEchoClient/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoServer/Desktop/UdpEchoServer/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoServer/Mobile/UdpEchoServer/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/UdpEchoClient/UdpEchoClient/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/UdpEchoServer/UdpEchoServer/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Mobile/SimpleHTTPClient/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Desktop/SimpleHTTPClient/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Shared/TestPreBuffer.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface TestPreBuffer : NSObject 5 | 6 | + (void)start; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Mobile/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuedong56/WifiDemo/HEAD/WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Mobile/Default-568h@2x.png -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/InterfaceTest/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuedong56/WifiDemo/HEAD/WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/InterfaceTest/Default-568h@2x.png -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Mobile/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuedong56/WifiDemo/HEAD/WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Mobile/Default-568h@2x.png -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Mobile/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuedong56/WifiDemo/HEAD/WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Mobile/Default-568h@2x.png -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Mobile/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuedong56/WifiDemo/HEAD/WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Mobile/Default-568h@2x.png -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Mobile/SimpleHTTPClient/SimpleHTTPClientViewController.m: -------------------------------------------------------------------------------- 1 | #import "SimpleHTTPClientViewController.h" 2 | 3 | 4 | @implementation SimpleHTTPClientViewController 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/EchoServer/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuedong56/WifiDemo/HEAD/WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/EchoServer/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /WifiDemo/WifiDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Mobile/SimpleHTTPClient/SimpleHTTPClientViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface SimpleHTTPClientViewController : UIViewController { 5 | 6 | } 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/EchoServer/EchoServer_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'EchoServer' target in the 'EchoServer' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/EchoServer/EchoServer_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'EchoServer' target in the 'EchoServer' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/ReadMe.txt: -------------------------------------------------------------------------------- 1 | The ConnectTest projects demonstrates some of the various options available for connecting to a host, such as: 2 | 3 | - Setting connect timeouts 4 | - Connecting to secure hosts (using SSL/TLS) -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Desktop/TestPreBuffer/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface AppDelegate : NSObject 5 | 6 | @property (assign) IBOutlet NSWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/EchoServer/English.lproj/MainMenu.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuedong56/WifiDemo/HEAD/WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/EchoServer/English.lproj/MainMenu.nib/keyedobjects.nib -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/BonjourClient/BonjourClient_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'BonjourClient' target in the 'BonjourClient' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/BonjourServer/BonjourServer_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'BonjourServer' target in the 'BonjourServer' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Mobile/ConnectTest/ConnectTestViewController.m: -------------------------------------------------------------------------------- 1 | #import "ConnectTestViewController.h" 2 | 3 | 4 | @implementation ConnectTestViewController 5 | 6 | @synthesize label = _label; 7 | 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Desktop/ConnectTest/ConnectTest-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'ConnectTest' target in the 'ConnectTest' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/UdpEchoClient/UdpEchoClient/UdpEchoClient-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'UdpEchoClient' target in the 'UdpEchoClient' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/UdpEchoServer/UdpEchoServer/UdpEchoServer-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'UdpEchoServer' target in the 'UdpEchoServer' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Desktop/TestPreBuffer/TestPreBuffer-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'TestPreBuffer' target in the 'TestPreBuffer' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Desktop/UdpEchoClient/UdpEchoClient-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'UdpEchoClient' target in the 'UdpEchoClient' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoServer/Desktop/UdpEchoServer/UdpEchoServer-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'UdpEchoServer' target in the 'UdpEchoServer' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/CocoaAsyncSocket.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Tests/CocoaAsyncSocket.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/EchoServer/EchoServer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Desktop/SimpleHTTPClient/SimpleHTTPClient-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'SimpleHTTPClient' target in the 'SimpleHTTPClient' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Mobile/ConnectTest/ConnectTestViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface ConnectTestViewController : UIViewController { 5 | 6 | } 7 | 8 | @property (nonatomic, strong) IBOutlet UILabel *label; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/EchoServer/EchoServer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/BonjourClient/BonjourClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/BonjourServer/BonjourServer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Desktop/ConnectTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Mobile/ConnectTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/InterfaceTest/InterfaceTest_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'InterfaceTest' target in the 'InterfaceTest' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // WifiDemo 4 | // 5 | // Created by yuedongkui on 16/8/2. 6 | // Copyright © 2016年 LY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : NSObject 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Mobile/TestPreBuffer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Mobile/UdpEchoClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoServer/Mobile/UdpEchoServer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/InterfaceTest/InterfaceTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/UdpEchoClient/UdpEchoClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/UdpEchoServer/UdpEchoServer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // WifiDemo 4 | // 5 | // Created by yuedongkui on 16/8/2. 6 | // Copyright © 2016年 LY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) { 12 | return NSApplicationMain(argc, argv); 13 | } 14 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Desktop/TestPreBuffer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Desktop/UdpEchoClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoServer/Desktop/UdpEchoServer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/Wifi_iOS_Demo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Wifi_iOS_Demo 4 | // 5 | // Created by yuedongkui on 16/8/3. 6 | // Copyright © 2016年 LY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Desktop/SimpleHTTPClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Mobile/SimpleHTTPClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/ReadMe.txt: -------------------------------------------------------------------------------- 1 | The SimpleHTTPClient projects are just a simple demonstration of reading and writing data using GCDAsyncSocket. Obviously it's not meant to be a full fledged HTTP client. There are other excellent libraries for that task. But the HTTP protocol itself is so simple, it makes for a great example. -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Mobile/TestPreBuffer/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class ViewController; 4 | 5 | 6 | @interface AppDelegate : UIResponder 7 | 8 | @property (strong, nonatomic) UIWindow *window; 9 | @property (strong, nonatomic) ViewController *viewController; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Mobile/UdpEchoClient/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class ViewController; 4 | 5 | 6 | @interface AppDelegate : UIResponder 7 | 8 | @property (strong, nonatomic) UIWindow *window; 9 | @property (strong, nonatomic) ViewController *viewController; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoServer/Mobile/UdpEchoServer/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class ViewController; 4 | 5 | 6 | @interface AppDelegate : UIResponder 7 | 8 | @property (strong, nonatomic) UIWindow *window; 9 | @property (strong, nonatomic) ViewController *viewController; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoServer/Mobile/UdpEchoServer/ViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface ViewController : UIViewController 5 | { 6 | IBOutlet UITextField *portField; 7 | IBOutlet UIButton *startStopButton; 8 | IBOutlet UIWebView *webView; 9 | } 10 | 11 | - (IBAction)startStop:(id)sender; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Tests/CocoaAsyncSocket.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/BonjourClient/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // BonjourClient 4 | // 5 | // Created by Robbie Hanson on 1/27/11. 6 | // Copyright 2011 Voalte. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/BonjourServer/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // BonjourServer 4 | // 5 | // Created by Robbie Hanson on 1/27/11. 6 | // Copyright 2011 Voalte. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Desktop/TestPreBuffer/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | #import "TestPreBuffer.h" 3 | 4 | 5 | @implementation AppDelegate 6 | 7 | @synthesize window = _window; 8 | 9 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 10 | { 11 | [TestPreBuffer start]; 12 | } 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/EchoServer/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // EchoServer 4 | // 5 | // Created by Robbie Hanson on 11/4/10. 6 | // Copyright 2010 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Mobile/TestPreBuffer/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // TestPreBuffer 4 | // 5 | // Created by Robbie Hanson on 6/7/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/EchoServer/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // EchoServer 4 | // 5 | // Created by Robbie Hanson on 7/10/08. 6 | // Copyright __MyCompanyName__ 2008. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } 15 | -------------------------------------------------------------------------------- /WifiDemo/Wifi_iOS_Demo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Wifi_iOS_Demo 4 | // 5 | // Created by yuedongkui on 16/8/3. 6 | // Copyright © 2016年 LY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /WifiDemo/Wifi_iOS_Demo/NSString+IP.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+IP.h 3 | // SmartFinder 4 | // 5 | // Created by yuedongkui on 2016/11/8. 6 | // Copyright © 2016年 Smartisan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (IP) 12 | 13 | + (NSString *)getIpLocally:(NSString *)networkInterface ipVersion:(int)ipVersion; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /WifiDemo/Wifi_iOS_Demo/SocketViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SocketViewController.h 3 | // WifiDemo 4 | // 5 | // Created by yuedongkui on 16/8/3. 6 | // Copyright © 2016年 LY. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SocketViewController : UIViewController 12 | 13 | - (instancetype)initWithIP:(NSString *)ip port:(NSInteger)port; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Tests/CocoaAsyncSocket.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Tests/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CocoaAsyncSocket (7.4.2) 3 | 4 | DEPENDENCIES: 5 | - CocoaAsyncSocket (from `../CocoaAsyncSocket.podspec`) 6 | 7 | EXTERNAL SOURCES: 8 | CocoaAsyncSocket: 9 | :path: ../CocoaAsyncSocket.podspec 10 | 11 | SPEC CHECKSUMS: 12 | CocoaAsyncSocket: f5783bdedd232d91b89769bc4b5a1580aed518ad 13 | 14 | COCOAPODS: 0.38.2 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Desktop/ConnectTest/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ConnectTest 4 | // 5 | // Created by Robbie Hanson on 7/23/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Mobile/UdpEchoClient/ViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface ViewController : UIViewController 5 | { 6 | IBOutlet UITextField *addrField; 7 | IBOutlet UITextField *portField; 8 | IBOutlet UITextField *messageField; 9 | IBOutlet UIWebView *webView; 10 | } 11 | 12 | - (IBAction)send:(id)sender; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/UdpEchoClient/UdpEchoClient/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // UdpEchoClient 4 | // 5 | // Created by Robbie Hanson on 4/1/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/UdpEchoServer/UdpEchoServer/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // UdpEchoServer 4 | // 5 | // Created by Robbie Hanson on 4/1/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Desktop/TestPreBuffer/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TestPreBuffer 4 | // 5 | // Created by Robbie Hanson on 6/7/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Desktop/UdpEchoClient/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // UdpEchoClient 4 | // 5 | // Created by Robbie Hanson on 11/28/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoServer/Desktop/UdpEchoServer/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // UdpEchoServer 4 | // 5 | // Created by Robbie Hanson on 11/23/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/QRCode/DataMatrix.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #import 4 | 5 | 6 | @interface DataMatrix : NSObject { 7 | 8 | int dim; 9 | bool** data; 10 | 11 | } 12 | 13 | - (id)initWith:(int)dimension; 14 | 15 | - (int)dimension; 16 | 17 | - (void)set:(bool)value x:(int)x y:(int)y; 18 | 19 | - (bool)valueAt:(int)x y:(int)y; 20 | 21 | - (NSString*)toString; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Desktop/SimpleHTTPClient/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SimpleHTTPClient 4 | // 5 | // Created by Robbie Hanson on 7/5/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Source/Vendor/CocoaLumberjack/Extensions/README.txt: -------------------------------------------------------------------------------- 1 | This folder contains some sample formatters that may be helpful. 2 | 3 | Feel free to change them, extend them, or use them as the basis for your own custom formatter(s). 4 | 5 | More information about creating your own custom formatters can be found on the wiki: 6 | https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomFormatters 7 | 8 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/InterfaceTest/Classes/InterfaceTestViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // InterfaceTestViewController.h 3 | // InterfaceTest 4 | // 5 | // Created by Robbie Hanson on 10/15/10. 6 | // Copyright 2010 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface InterfaceTestViewController : UIViewController { 12 | 13 | } 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Tests/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | use_frameworks! 4 | 5 | target :CocoaAsyncSocketTestsMac do 6 | platform :osx, '10.8' 7 | pod 'CocoaAsyncSocket', :path => '../CocoaAsyncSocket.podspec' 8 | end 9 | 10 | target :CocoaAsyncSocketTestsiOS do 11 | platform :ios, '8.0' 12 | pod 'CocoaAsyncSocket', :path => '../CocoaAsyncSocket.podspec' 13 | end -------------------------------------------------------------------------------- /WifiDemo/Wifi_iOS_Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Wifi_iOS_Demo 4 | // 5 | // Created by yuedongkui on 16/8/3. 6 | // Copyright © 2016年 LY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Desktop/ConnectTest/ConnectTestAppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class GCDAsyncSocket; 4 | 5 | 6 | @interface ConnectTestAppDelegate : NSObject { 7 | @private 8 | GCDAsyncSocket *asyncSocket; 9 | 10 | NSWindow *__unsafe_unretained window; 11 | } 12 | 13 | @property (unsafe_unretained) IBOutlet NSWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/EchoServer/AppController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class AsyncSocket; 4 | 5 | @interface AppController : NSObject 6 | { 7 | AsyncSocket *listenSocket; 8 | NSMutableArray *connectedSockets; 9 | 10 | BOOL isRunning; 11 | 12 | IBOutlet id logView; 13 | IBOutlet id portField; 14 | IBOutlet id startStopButton; 15 | } 16 | - (IBAction)startStop:(id)sender; 17 | @end 18 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Mobile/ConnectTest/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ConnectTest 4 | // 5 | // Created by Robbie Hanson on 7/25/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | @autoreleasepool { 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | return retVal; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Desktop/SimpleHTTPClient/SimpleHTTPClientAppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class GCDAsyncSocket; 4 | 5 | 6 | @interface SimpleHTTPClientAppDelegate : NSObject { 7 | @private 8 | GCDAsyncSocket *asyncSocket; 9 | 10 | NSWindow *__unsafe_unretained window; 11 | } 12 | 13 | @property (unsafe_unretained) IBOutlet NSWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Mobile/SimpleHTTPClient/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SimpleHTTPClient 4 | // 5 | // Created by Robbie Hanson on 7/5/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | @autoreleasepool { 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | return retVal; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/InterfaceTest/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // InterfaceTest 4 | // 5 | // Created by Robbie Hanson on 10/15/10. 6 | // Copyright 2010 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) { 12 | 13 | @autoreleasepool { 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | return retVal; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Mobile/ConnectTest/ConnectTest-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'ConnectTest' target in the 'ConnectTest' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Mobile/TestPreBuffer/TestPreBuffer-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'TestPreBuffer' target in the 'TestPreBuffer' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Mobile/UdpEchoClient/UdpEchoClient-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'UdpEchoClient' target in the 'UdpEchoClient' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoServer/Mobile/UdpEchoServer/UdpEchoServer-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'UdpEchoServer' target in the 'UdpEchoServer' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Mobile/ConnectTest/ConnectTestAppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class ConnectTestViewController; 4 | @class GCDAsyncSocket; 5 | 6 | 7 | @interface ConnectTestAppDelegate : NSObject 8 | { 9 | GCDAsyncSocket *asyncSocket; 10 | } 11 | 12 | @property (nonatomic, strong) IBOutlet UIWindow *window; 13 | @property (nonatomic, strong) IBOutlet ConnectTestViewController *viewController; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/BonjourServer/BonjourServerAppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class GCDAsyncSocket; 4 | 5 | 6 | @interface BonjourServerAppDelegate : NSObject 7 | { 8 | NSNetService *netService; 9 | GCDAsyncSocket *asyncSocket; 10 | NSMutableArray *connectedSockets; 11 | 12 | NSWindow *__unsafe_unretained window; 13 | } 14 | 15 | @property (unsafe_unretained) IBOutlet NSWindow *window; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Mobile/SimpleHTTPClient/SimpleHTTPClient-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'SimpleHTTPClient' target in the 'SimpleHTTPClient' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Mobile/TestPreBuffer/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TestPreBuffer 4 | // 5 | // Created by Robbie Hanson on 6/7/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Mobile/UdpEchoClient/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // UdpEchoClient 4 | // 5 | // Created by Robbie Hanson on 4/5/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoServer/Mobile/UdpEchoServer/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // UdpEchoServer 4 | // 5 | // Created by Robbie Hanson on 4/8/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Mobile/SimpleHTTPClient/SimpleHTTPClientAppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class SimpleHTTPClientViewController; 4 | @class GCDAsyncSocket; 5 | 6 | 7 | @interface SimpleHTTPClientAppDelegate : NSObject 8 | { 9 | GCDAsyncSocket *asyncSocket; 10 | } 11 | 12 | @property (nonatomic) IBOutlet UIWindow *window; 13 | @property (nonatomic) IBOutlet SimpleHTTPClientViewController *viewController; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoServer/Desktop/UdpEchoServer/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "GCDAsyncUdpSocket.h" 3 | 4 | 5 | @interface AppDelegate : NSObject 6 | { 7 | GCDAsyncUdpSocket *udpSocket; 8 | BOOL isRunning; 9 | } 10 | 11 | @property (unsafe_unretained) IBOutlet NSWindow *window; 12 | @property IBOutlet NSTextField *portField; 13 | @property IBOutlet NSButton *startStopButton; 14 | @property IBOutlet NSTextView *logView; 15 | 16 | - (IBAction)startStopButtonPressed:(id)sender; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/UdpEchoServer/UdpEchoServer/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "AsyncUdpSocket.h" 3 | 4 | 5 | @interface AppDelegate : NSObject 6 | { 7 | AsyncUdpSocket *udpSocket; 8 | BOOL isRunning; 9 | } 10 | 11 | @property (unsafe_unretained) IBOutlet NSWindow *window; 12 | 13 | @property IBOutlet NSTextField *portField; 14 | @property IBOutlet NSButton *startStopButton; 15 | @property IBOutlet NSTextView *logView; 16 | 17 | - (IBAction)startStopButtonPressed:(id)sender; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/InterfaceTest/Classes/InterfaceTestAppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class InterfaceTestViewController; 4 | @class AsyncSocket; 5 | 6 | 7 | @interface InterfaceTestAppDelegate : NSObject 8 | { 9 | CFHostRef host; 10 | AsyncSocket *asyncSocket; 11 | 12 | UIWindow *window; 13 | InterfaceTestViewController *viewController; 14 | } 15 | 16 | @property (nonatomic) IBOutlet UIWindow *window; 17 | @property (nonatomic) IBOutlet InterfaceTestViewController *viewController; 18 | 19 | @end 20 | 21 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/BonjourClient/BonjourClientAppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class GCDAsyncSocket; 4 | 5 | 6 | @interface BonjourClientAppDelegate : NSObject 7 | { 8 | NSNetServiceBrowser *netServiceBrowser; 9 | NSNetService *serverService; 10 | NSMutableArray *serverAddresses; 11 | GCDAsyncSocket *asyncSocket; 12 | BOOL connected; 13 | 14 | NSWindow *__unsafe_unretained window; 15 | } 16 | 17 | @property (unsafe_unretained) IBOutlet NSWindow *window; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/UdpEchoClient/UdpEchoClient/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "AsyncUdpSocket.h" 3 | 4 | 5 | @interface AppDelegate : NSObject 6 | { 7 | long tag; 8 | AsyncUdpSocket *udpSocket; 9 | } 10 | 11 | @property (assign) IBOutlet NSWindow *window; 12 | 13 | @property IBOutlet NSTextField * addrField; 14 | @property IBOutlet NSTextField * portField; 15 | @property IBOutlet NSTextField * messageField; 16 | @property IBOutlet NSButton * sendButton; 17 | @property IBOutlet NSTextView * logView; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode6.4 3 | 4 | before_install: 5 | - gem install cocoapods --no-rdoc --no-ri 6 | 7 | install: 8 | - pod install --project-directory=./Tests 9 | 10 | script: 11 | - xctool -workspace ./Tests/CocoaAsyncSocket.xcworkspace -scheme CocoaAsyncSocketTestsiOS -sdk iphonesimulator -arch i386 test 12 | - xctool -workspace ./Tests/CocoaAsyncSocket.xcworkspace -scheme CocoaAsyncSocketTestsMac -sdk macosx -arch x86_64 test 13 | - xctool -project CocoaAsyncSocket.xcodeproj -scheme "iOS Framework" -sdk iphonesimulator -arch i386 build -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/EchoServer/EchoServerAppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class GCDAsyncSocket; 4 | 5 | 6 | @interface EchoServerAppDelegate : NSObject 7 | { 8 | dispatch_queue_t socketQueue; 9 | 10 | GCDAsyncSocket *listenSocket; 11 | NSMutableArray *connectedSockets; 12 | 13 | BOOL isRunning; 14 | 15 | IBOutlet id logView; 16 | IBOutlet id portField; 17 | IBOutlet id startStopButton; 18 | 19 | NSWindow *__unsafe_unretained window; 20 | } 21 | 22 | @property (unsafe_unretained) IBOutlet NSWindow *window; 23 | 24 | - (IBAction)startStop:(id)sender; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Desktop/ConnectTest/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/UdpEchoClient/UdpEchoClient/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/UdpEchoServer/UdpEchoServer/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Desktop/TestPreBuffer/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Desktop/UdpEchoClient/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class GCDAsyncUdpSocket; 4 | 5 | 6 | @interface AppDelegate : NSObject 7 | { 8 | long tag; 9 | GCDAsyncUdpSocket *udpSocket; 10 | } 11 | 12 | @property (unsafe_unretained) IBOutlet NSWindow * window; 13 | @property IBOutlet NSTextField * addrField; 14 | @property IBOutlet NSTextField * portField; 15 | @property IBOutlet NSTextField * messageField; 16 | @property IBOutlet NSButton * sendButton; 17 | @property IBOutlet NSTextView * logView; 18 | 19 | - (IBAction)send:(id)sender; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Desktop/UdpEchoClient/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoServer/Desktop/UdpEchoServer/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Desktop/SimpleHTTPClient/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Source/CocoaAsyncSocket.h: -------------------------------------------------------------------------------- 1 | // 2 | // CocoaAsyncSocket.h 3 | // CocoaAsyncSocket 4 | // 5 | // Created by Derek Clarkson on 10/08/2015. 6 | // Copyright © 2015 Robbie Hanson. All rights reserved. 7 | // 8 | 9 | @import Foundation; 10 | 11 | //! Project version number for CocoaAsyncSocket. 12 | FOUNDATION_EXPORT double cocoaAsyncSocketVersionNumber; 13 | 14 | //! Project version string for CocoaAsyncSocket. 15 | FOUNDATION_EXPORT const unsigned char cocoaAsyncSocketVersionString[]; 16 | 17 | #import 18 | #import 19 | #import 20 | #import 21 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/EchoServer/Instructions.txt: -------------------------------------------------------------------------------- 1 | First, build and run the EchoServer. 2 | You can set it to run on a specific port, or allow to pick an available port. 3 | Now start the echo server. It will output the port it started on. 4 | 5 | You can now use telnet to connect to the echo server and test it. 6 | Using the Terminal (/Applications/Utilities/Terminal.app) 7 | type in the following: 8 | telnet localhost [port] 9 | 10 | where "[port]" is replaced by the port the Echo server is running on. 11 | 12 | Type in anything you want, and hit return. 13 | Whatever you typed in will be displayed in the Echo Server, and echoed back to you. 14 | 15 | To end your telnet session hit Ctrl-], and type "quit". -------------------------------------------------------------------------------- /WifiDemo/Wifi_iOS_Demo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Wifi_iOS_Demo 4 | // 5 | // Created by yuedongkui on 16/8/3. 6 | // Copyright © 2016年 LY. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | 17 | 18 | @implementation AppDelegate 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 21 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 22 | self.window.backgroundColor = [UIColor whiteColor]; 23 | [self.window makeKeyAndVisible]; 24 | 25 | self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[ViewController alloc] init]]; 26 | 27 | return YES; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Tests/Mac/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.chrisballinger.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Tests/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.chrisballinger.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /WifiDemo/Wifi_iOS_Demo/UIAlertView+Common.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIAlertView+Common.h 3 | // LYUniversalProject 4 | // 5 | // Created by 老岳 on 14-12-23. 6 | // Copyright (c) 2014年 老岳. All rights reserved. 7 | // 8 | 9 | #import 10 | typedef void(^FinishBlock)(NSInteger buttonIndex); 11 | 12 | @interface UIAlertView (Common) 13 | 14 | + (void)alertWithMsg:(NSString *)msg 15 | btnTitle:(NSString *)btnTitle 16 | block:(FinishBlock)block; 17 | 18 | + (void)alertWithMsg:(NSString *)msg 19 | btnTitle:(NSString *)btnTitle 20 | otherBtnTitle:(NSString *)otherBtnTitle 21 | block:(FinishBlock)block; 22 | 23 | + (void)alertWithTitle:(NSString *)title 24 | msg:(NSString *)msg 25 | btnTitle:(NSString *)btnTitle 26 | otherBtnTitle:(NSString *)otherBtnTitle 27 | block:(FinishBlock)block; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /WifiDemo/Wifi_iOS_Demo/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // WifiDemo 4 | // 5 | // Created by yuedongkui on 16/8/3. 6 | // Copyright © 2016年 LY. All rights reserved. 7 | // 8 | 9 | #ifndef PrefixHeader_pch 10 | #define PrefixHeader_pch 11 | 12 | // Include any system framework and library headers here that should be included in all compilation units. 13 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. 14 | 15 | 16 | //AppDelegate 17 | #define APP_DELEGATE ((LYAppDelegate *)[[UIApplication sharedApplication] delegate]) 18 | 19 | //打印 20 | #ifdef DEBUG 21 | #define CLog(format, ...) NSLog(format,##__VA_ARGS__) 22 | #else 23 | #define CLog(format, ...) 24 | #endif 25 | 26 | //尺寸 27 | #define ScreenWidth [UIScreen mainScreen].bounds.size.width 28 | #define ScreenHeight [UIScreen mainScreen].bounds.size.height 29 | 30 | 31 | #endif /* PrefixHeader_pch */ 32 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Source/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Mobile/TestPreBuffer/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | #import "ViewController.h" 3 | #import "TestPreBuffer.h" 4 | 5 | 6 | @implementation AppDelegate 7 | 8 | @synthesize window; 9 | @synthesize viewController; 10 | 11 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 12 | { 13 | [TestPreBuffer start]; 14 | 15 | // Normal UI stuff 16 | 17 | window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 18 | if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { 19 | viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil]; 20 | } else { 21 | viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil]; 22 | } 23 | window.rootViewController = self.viewController; 24 | [window makeKeyAndVisible]; 25 | return YES; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/EchoServer/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.EchoServer 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | NSMainNibFile 24 | MainMenu 25 | NSPrincipalClass 26 | NSApplication 27 | 28 | 29 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Mobile/TestPreBuffer/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // TestPreBuffer 4 | // 5 | // Created by Robbie Hanson on 6/7/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | } 22 | 23 | - (void)viewDidUnload 24 | { 25 | [super viewDidUnload]; 26 | // Release any retained subviews of the main view. 27 | } 28 | 29 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 30 | { 31 | if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { 32 | return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); 33 | } else { 34 | return YES; 35 | } 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Source/Vendor/CocoaLumberjack/Extensions/DDMultiFormatter.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "DDLog.h" 3 | 4 | /** 5 | * Welcome to Cocoa Lumberjack! 6 | * 7 | * The project page has a wealth of documentation if you have any questions. 8 | * https://github.com/CocoaLumberjack/CocoaLumberjack 9 | * 10 | * If you're new to the project you may wish to read the "Getting Started" page. 11 | * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted 12 | * 13 | * 14 | * This formatter can be used to chain different formatters together. 15 | * The log message will processed in the order of the formatters added. 16 | **/ 17 | 18 | @interface DDMultiFormatter : NSObject 19 | 20 | /** 21 | * Array of chained formatters 22 | */ 23 | @property (readonly) NSArray *formatters; 24 | 25 | - (void)addFormatter:(id)formatter; 26 | - (void)removeFormatter:(id)formatter; 27 | - (void)removeAllFormatters; 28 | - (BOOL)isFormattingWithFormatter:(id)formatter; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/InterfaceTest/InterfaceTest-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | 30 | 31 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/EchoServer/EchoServer-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/BonjourClient/BonjourClient-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/BonjourServer/BonjourServer-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Desktop/ConnectTest/ConnectTest-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.deusty.oss.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Desktop/SimpleHTTPClient/SimpleHTTPClient-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.deusty.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2016年 LY. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Desktop/TestPreBuffer/TestPreBuffer-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.deusty.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2012 __MyCompanyName__. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/UdpEchoClient/UdpEchoClient/UdpEchoClient-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.deusty.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2012 __MyCompanyName__. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/UdpEchoServer/UdpEchoServer/UdpEchoServer-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.deusty.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2012 __MyCompanyName__. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Desktop/UdpEchoClient/UdpEchoClient-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.deusty.oss.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2011 __MyCompanyName__. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoServer/Desktop/UdpEchoServer/UdpEchoServer-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.deusty.oss.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2011 __MyCompanyName__. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/QRCode/QREncoder.h: -------------------------------------------------------------------------------- 1 | 2 | #ifdef __OBJC__ 3 | #import 4 | #import 5 | #import 6 | #import 7 | #endif 8 | 9 | #import "DataMatrix.h" 10 | 11 | #define QR_LEVEL_L 0 12 | #define QR_LEVEL_M 1 13 | #define QR_LEVEL_Q 2 14 | #define QR_LEVEL_H 3 15 | 16 | const static int QR_ECLEVEL_AUTO = 0; 17 | const static int QR_ECLEVEL_H = QR_LEVEL_H; 18 | const static int QR_ECLEVEL_M = QR_LEVEL_M; 19 | const static int QR_ECLEVEL_L = QR_LEVEL_L; 20 | const static int QR_ECLEVEL_Q = QR_LEVEL_Q; 21 | 22 | const static int QR_VERSION_AUTO = -1; 23 | 24 | const static int BITS_PER_BYTE = 8; 25 | const static int BYTES_PER_PIXEL = 4; 26 | 27 | const static unsigned char WHITE = 0xff; 28 | 29 | @interface QREncoder : NSObject { 30 | 31 | } 32 | 33 | + (DataMatrix*)encodeWithECLevel:(int)ecLevel version:(int)version string:(NSString *)string AESPassphrase:(NSString*)AESPassphrase; 34 | 35 | + (DataMatrix*)encodeWithECLevel:(int)ecLevel version:(int)version string:(NSString*)string; 36 | 37 | + (NSImage*)renderDataMatrix:(DataMatrix*)matrix imageDimension:(int)imageDimension withBgColor:(uint32_t)bg withCodeColor:(uint32_t)cg; 38 | 39 | @end 40 | 41 | void FLProviderReleaseData(void *info, const void *data, size_t size); 42 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/QRCode/DataMatrix.mm: -------------------------------------------------------------------------------- 1 | 2 | 3 | #import "DataMatrix.h" 4 | 5 | 6 | @implementation DataMatrix 7 | 8 | - (id)initWith:(int)dimension { 9 | if ([super init]) { 10 | self->dim = dimension; 11 | self->data = (bool**)malloc(sizeof(bool*) * self->dim); 12 | for (int y=0; ydim; y++) { 13 | self->data[y] = (bool*)malloc(sizeof(bool) * self->dim); 14 | if (self->data[y]==NULL) { 15 | NSLog(@"null!"); 16 | } 17 | } 18 | 19 | } 20 | return self; 21 | } 22 | 23 | - (int)dimension { 24 | return self->dim; 25 | } 26 | 27 | - (void)set:(bool)value x:(int)x y:(int)y { 28 | self->data[y][x] = value; 29 | } 30 | 31 | - (bool)valueAt:(int)x y:(int)y { 32 | return self->data[y][x]; 33 | } 34 | 35 | - (NSString*)toString { 36 | NSString* string = [NSString string]; 37 | for (int y=0; ydim; y++) { 38 | for (int x=0; xdim; x++) { 39 | bool value = self->data[y][x]; 40 | string = [string stringByAppendingFormat:@"%d", value]; 41 | } 42 | string = [string stringByAppendingString:@"\n"]; 43 | } 44 | return string; 45 | } 46 | 47 | - (void)dealloc { 48 | for (int y=0; ydim; y++) { 49 | free(self->data[y]); 50 | } 51 | free(self->data); 52 | //[super dealloc]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Mobile/UdpEchoClient/UdpEchoClient-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.deusty.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoServer/Mobile/UdpEchoServer/UdpEchoServer-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.deusty.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Source/Vendor/CocoaLumberjack/DDASLLogger.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import "DDLog.h" 5 | 6 | /** 7 | * Welcome to Cocoa Lumberjack! 8 | * 9 | * The project page has a wealth of documentation if you have any questions. 10 | * https://github.com/CocoaLumberjack/CocoaLumberjack 11 | * 12 | * If you're new to the project you may wish to read the "Getting Started" wiki. 13 | * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted 14 | * 15 | * 16 | * This class provides a logger for the Apple System Log facility. 17 | * 18 | * As described in the "Getting Started" page, 19 | * the traditional NSLog() function directs it's output to two places: 20 | * 21 | * - Apple System Log 22 | * - StdErr (if stderr is a TTY) so log statements show up in Xcode console 23 | * 24 | * To duplicate NSLog() functionality you can simply add this logger and a tty logger. 25 | * However, if you instead choose to use file logging (for faster performance), 26 | * you may choose to use a file logger and a tty logger. 27 | **/ 28 | 29 | @interface DDASLLogger : DDAbstractLogger 30 | { 31 | aslclient client; 32 | } 33 | 34 | + (instancetype)sharedInstance; 35 | 36 | // Inherited from DDAbstractLogger 37 | 38 | // - (id )logFormatter; 39 | // - (void)setLogFormatter:(id )formatter; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Mobile/UdpEchoClient/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | #import "ViewController.h" 3 | #import "DDLog.h" 4 | #import "DDTTYLogger.h" 5 | 6 | // Log levels: off, error, warn, info, verbose 7 | static const int ddLogLevel = LOG_LEVEL_VERBOSE; 8 | 9 | 10 | @implementation AppDelegate 11 | 12 | @synthesize window = _window; 13 | @synthesize viewController = _viewController; 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | // Setup our logging framework. 18 | [DDLog addLogger:[DDTTYLogger sharedInstance]]; 19 | 20 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 21 | 22 | self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; 23 | self.window.rootViewController = self.viewController; 24 | 25 | [self.window makeKeyAndVisible]; 26 | return YES; 27 | } 28 | 29 | - (void)applicationWillResignActive:(UIApplication *)application 30 | { 31 | } 32 | 33 | - (void)applicationDidEnterBackground:(UIApplication *)application 34 | { 35 | } 36 | 37 | - (void)applicationWillEnterForeground:(UIApplication *)application 38 | { 39 | } 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application 42 | { 43 | } 44 | 45 | - (void)applicationWillTerminate:(UIApplication *)application 46 | { 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Mobile/ConnectTest/ConnectTest-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.deusty.oss.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Mobile/SimpleHTTPClient/SimpleHTTPClient-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.deusty.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoServer/Mobile/UdpEchoServer/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | #import "ViewController.h" 3 | #import "DDLog.h" 4 | #import "DDTTYLogger.h" 5 | 6 | // Log levels: off, error, warn, info, verbose 7 | static const int ddLogLevel = LOG_LEVEL_VERBOSE; 8 | 9 | 10 | @implementation AppDelegate 11 | 12 | @synthesize window = _window; 13 | @synthesize viewController = _viewController; 14 | 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | // Setup our logging framework. 19 | 20 | [DDLog addLogger:[DDTTYLogger sharedInstance]]; 21 | 22 | // Setup UI 23 | 24 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 25 | self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; 26 | self.window.rootViewController = self.viewController; 27 | [self.window makeKeyAndVisible]; 28 | return YES; 29 | } 30 | 31 | - (void)applicationWillResignActive:(UIApplication *)application 32 | { 33 | } 34 | 35 | - (void)applicationDidEnterBackground:(UIApplication *)application 36 | { 37 | } 38 | 39 | - (void)applicationWillEnterForeground:(UIApplication *)application 40 | { 41 | } 42 | 43 | - (void)applicationDidBecomeActive:(UIApplication *)application 44 | { 45 | } 46 | 47 | - (void)applicationWillTerminate:(UIApplication *)application 48 | { 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/InterfaceTest/Readme.txt: -------------------------------------------------------------------------------- 1 | InterfaceTest is an iPhone project that demonstrates some of AsyncSocket's interface abilities. 2 | 3 | Most machines have multiple network interfaces. For example: 4 | - Ethernet 5 | - WiFi 6 | - 3G (cellular) 7 | - Bluetooth 8 | - Loopback (local machine only) 9 | 10 | Which leads to the question: 11 | If you are setting up sockets, which interface will your socket be running on? 12 | 13 | By default, if you don't specify an inteface, then the following rules generally apply: 14 | 15 | - Server sockets (listening/accepting) will accept incoming connections on any inteface. 16 | - Client sockets (connecting) will make outgoing connections on the primary interface. 17 | 18 | The primary interface on iPhone is WiFi. 19 | The primary interface on Mac is configurable via system preferences. 20 | 21 | But you can specify a particular interface using AsyncSocket. There are various examples of when one might want to do this. 22 | 23 | - You're trying to make a bluetooth connection. 24 | 25 | - Your iPhone app only supports WiFi, so you need to ensure your socket is only using the WiFi interface. 26 | 27 | - You want to create a local-only server socket on Mac for inter-process communication. You want to ensure only processes running on the local device can connect to your server. 28 | 29 | 30 | The IntefaceTest project demonstrates specifying a particular interface to use for an outgoing connection to google.com. You can force either the WiFi interface or the 3G/cellular interface. -------------------------------------------------------------------------------- /WifiDemo/Wifi_iOS_Demo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "83.5x83.5", 66 | "scale" : "2x" 67 | } 68 | ], 69 | "info" : { 70 | "version" : 1, 71 | "author" : "xcode" 72 | } 73 | } -------------------------------------------------------------------------------- /WifiDemo/Wifi_iOS_Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Mobile/TestPreBuffer/TestPreBuffer-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.deusty.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/InterfaceTest/Classes/InterfaceTestViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // InterfaceTestViewController.m 3 | // InterfaceTest 4 | // 5 | // Created by Robbie Hanson on 10/15/10. 6 | // Copyright 2010 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "InterfaceTestViewController.h" 10 | 11 | @implementation InterfaceTestViewController 12 | 13 | 14 | 15 | /* 16 | // The designated initializer. Override to perform setup that is required before the view is loaded. 17 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 18 | if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { 19 | // Custom initialization 20 | } 21 | return self; 22 | } 23 | */ 24 | 25 | /* 26 | // Implement loadView to create a view hierarchy programmatically, without using a nib. 27 | - (void)loadView { 28 | } 29 | */ 30 | 31 | 32 | /* 33 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 34 | - (void)viewDidLoad { 35 | [super viewDidLoad]; 36 | } 37 | */ 38 | 39 | 40 | /* 41 | // Override to allow orientations other than the default portrait orientation. 42 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 43 | // Return YES for supported orientations 44 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 45 | } 46 | */ 47 | 48 | - (void)didReceiveMemoryWarning { 49 | // Releases the view if it doesn't have a superview. 50 | [super didReceiveMemoryWarning]; 51 | 52 | // Release any cached data, images, etc that aren't in use. 53 | } 54 | 55 | - (void)viewDidUnload { 56 | // Release any retained subviews of the main view. 57 | // e.g. self.myOutlet = nil; 58 | } 59 | 60 | 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/CocoaAsyncSocket.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'CocoaAsyncSocket' 3 | s.version = '7.4.2' 4 | s.license = { :type => 'public domain', :text => <<-LICENSE 5 | Public Domain License 6 | 7 | The CocoaAsyncSocket project is in the public domain. 8 | 9 | The original TCP version (AsyncSocket) was created by Dustin Voss in January 2003. 10 | Updated and maintained by Deusty LLC and the Apple development community. 11 | LICENSE 12 | } 13 | s.summary = 'Asynchronous socket networking library for Mac and iOS.' 14 | s.homepage = 'https://github.com/robbiehanson/CocoaAsyncSocket' 15 | s.authors = 'Dustin Voss', { 'Robbie Hanson' => 'robbiehanson@deusty.com' } 16 | 17 | s.source = { :git => 'https://github.com/robbiehanson/CocoaAsyncSocket.git', 18 | :tag => "#{s.version}" } 19 | 20 | s.description = 'CocoaAsyncSocket supports TCP and UDP. The AsyncSocket class is for TCP, and the AsyncUdpSocket class is for UDP. ' \ 21 | 'AsyncSocket is a TCP/IP socket networking library that wraps CFSocket and CFStream. It offers asynchronous ' \ 22 | 'operation, and a native Cocoa class complete with delegate support or use the GCD variant GCDAsyncSocket. ' \ 23 | 'AsyncUdpSocket is a UDP/IP socket networking library that wraps CFSocket. It works almost exactly like the TCP ' \ 24 | 'version, but is designed specifically for UDP. This includes queued non-blocking send/receive operations, full ' \ 25 | 'delegate support, run-loop based, self-contained class, and support for IPv4 and IPv6.' 26 | 27 | s.source_files = 'Source/{GCD,RunLoop}/*.{h,m}', 'Source/CocoaAsyncSocket.h' 28 | 29 | s.requires_arc = true 30 | 31 | # dispatch_queue_set_specific() is available in OS X v10.7+ and iOS 5.0+ 32 | s.ios.deployment_target = '5.0' 33 | s.osx.deployment_target = '10.7' 34 | 35 | s.ios.frameworks = 'CFNetwork', 'Security' 36 | s.osx.frameworks = 'CoreServices', 'Security' 37 | end 38 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Source/GCD/Documentation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to the CocoaAsyncSocket project!

5 | 6 |

7 | A wealth of documentation can be found on the Google Code homepage:
8 | https://github.com/robbiehanson/CocoaAsyncSocket 9 |

10 | 11 |

12 | If you are new to networking, it is recommended you start by reading the Intro page:
13 | https://github.com/robbiehanson/CocoaAsyncSocket/wiki/Intro 14 |

15 | 16 |

17 | If you are a seasoned networking professional, with 10+ years of experience writing low-level socket code, 18 | and detailed knowledge of the underlying BSD networking stack, then you can skip the CommonPitfalls page.
19 | Otherwise, it should be considered mandatory reading:
20 | https://github.com/robbiehanson/CocoaAsyncSocket/wiki/CommonPitfalls 21 |

22 | 23 |

24 | A little bit of investment in your knowledge and understanding of networking fundamentals can go a long way.
25 | And it can save you a LOT of time and frustration in the long run. 26 |

27 | 28 |

29 | Your first goto for reference should ALWAYS be the header files. They are extremely well documented. Please read them. 30 |

31 | 32 |

33 | Did I mention you should read the headers? They're docemented very nicely, in plain english. 34 |

35 | 36 |

37 | If you have any questions you are welcome to post to the CocoaAsyncSocket mailing list:
38 | http://groups.google.com/group/cocoaasyncsocket
39 |
40 | The list is archived, and available for browsing online.
41 | You may be able to instantly find the answer you're looking for with a quick search.
42 |

43 | 44 |

We hope the CocoaAsyncSocket project can provide you with powerful and easy to use networking libraries.

45 | 46 | 47 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Source/RunLoop/Documentation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Welcome to the CocoaAsyncSocket project!

5 | 6 |

7 | A wealth of documentation can be found on the Google Code homepage:
8 | https://github.com/robbiehanson/CocoaAsyncSocket 9 |

10 | 11 |

12 | If you are new to networking, it is recommended you start by reading the Intro page:
13 | https://github.com/robbiehanson/CocoaAsyncSocket/wiki/Intro 14 |

15 | 16 |

17 | If you are a seasoned networking professional, with 10+ years of experience writing low-level socket code, 18 | and detailed knowledge of the underlying BSD networking stack, then you can skip the CommonPitfalls page.
19 | Otherwise, it should be considered mandatory reading:
20 | https://github.com/robbiehanson/CocoaAsyncSocket/wiki/CommonPitfalls 21 |

22 | 23 |

24 | A little bit of investment in your knowledge and understanding of networking fundamentals can go a long way.
25 | And it can save you a LOT of time and frustration in the long run. 26 |

27 | 28 |

29 | Your first goto for reference should ALWAYS be the header files. They are extremely well documented. Please read them. 30 |

31 | 32 |

33 | Did I mention you should read the headers? They're docemented very nicely, in plain english. 34 |

35 | 36 |

37 | If you have any questions you are welcome to post to the CocoaAsyncSocket mailing list:
38 | http://groups.google.com/group/cocoaasyncsocket
39 |
40 | The list is archived, and available for browsing online.
41 | You may be able to instantly find the answer you're looking for with a quick search.
42 |

43 | 44 |

We hope the CocoaAsyncSocket project can provide you with powerful and easy to use networking libraries.

45 | 46 | 47 | -------------------------------------------------------------------------------- /WifiDemo/Wifi_iOS_Demo/UIAlertView+Common.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIAlertView+Common.m 3 | // LYUniversalProject 4 | // 5 | // Created by 老岳 on 14-12-23. 6 | // Copyright (c) 2014年 老岳. All rights reserved. 7 | // 8 | 9 | #import "UIAlertView+Common.h" 10 | #import 11 | 12 | @implementation UIAlertView (Common) 13 | 14 | #pragma mark - Init Method 15 | + (void)alertWithMsg:(NSString *)msg 16 | btnTitle:(NSString *)btnTitle 17 | block:(FinishBlock)block 18 | { 19 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:msg delegate:nil cancelButtonTitle:nil otherButtonTitles:btnTitle, nil]; 20 | [alertView showAlertWithBlock:block]; 21 | } 22 | 23 | + (void)alertWithMsg:(NSString *)msg 24 | btnTitle:(NSString *)btnTitle 25 | otherBtnTitle:(NSString *)otherBtnTitle 26 | block:(FinishBlock)block 27 | { 28 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:msg delegate:nil cancelButtonTitle:nil otherButtonTitles:btnTitle, otherBtnTitle, nil]; 29 | [alertView showAlertWithBlock:block]; 30 | } 31 | 32 | + (void)alertWithTitle:(NSString *)title 33 | msg:(NSString *)msg 34 | btnTitle:(NSString *)btnTitle 35 | otherBtnTitle:(NSString *)otherBtnTitle 36 | block:(FinishBlock)block 37 | { 38 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title message:msg delegate:nil cancelButtonTitle:nil otherButtonTitles:btnTitle, otherBtnTitle, nil]; 39 | [alertView showAlertWithBlock:block]; 40 | } 41 | 42 | #pragma mark - 43 | static char key; 44 | - (void)showAlertWithBlock:(FinishBlock)block 45 | { 46 | if (block) { 47 | objc_removeAssociatedObjects(self); 48 | objc_setAssociatedObject(self, &key, block, OBJC_ASSOCIATION_COPY); 49 | self.delegate = self; 50 | } 51 | [self show]; 52 | } 53 | 54 | #pragma mark - UIAlertView Delegate 55 | - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex 56 | { 57 | FinishBlock block = objc_getAssociatedObject(self, &key); 58 | if (block) { 59 | block(buttonIndex); 60 | } 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Source/Vendor/CocoaLumberjack/Extensions/DDContextFilterLogFormatter.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "DDLog.h" 3 | 4 | /** 5 | * Welcome to Cocoa Lumberjack! 6 | * 7 | * The project page has a wealth of documentation if you have any questions. 8 | * https://github.com/CocoaLumberjack/CocoaLumberjack 9 | * 10 | * If you're new to the project you may wish to read the "Getting Started" page. 11 | * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted 12 | * 13 | * 14 | * This class provides a log formatter that filters log statements from a logging context not on the whitelist. 15 | * 16 | * A log formatter can be added to any logger to format and/or filter its output. 17 | * You can learn more about log formatters here: 18 | * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomFormatters 19 | * 20 | * You can learn more about logging context's here: 21 | * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomContext 22 | * 23 | * But here's a quick overview / refresher: 24 | * 25 | * Every log statement has a logging context. 26 | * These come from the underlying logging macros defined in DDLog.h. 27 | * The default logging context is zero. 28 | * You can define multiple logging context's for use in your application. 29 | * For example, logically separate parts of your app each have a different logging context. 30 | * Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context. 31 | **/ 32 | @interface DDContextWhitelistFilterLogFormatter : NSObject 33 | 34 | - (id)init; 35 | 36 | - (void)addToWhitelist:(int)loggingContext; 37 | - (void)removeFromWhitelist:(int)loggingContext; 38 | 39 | - (NSArray *)whitelist; 40 | 41 | - (BOOL)isOnWhitelist:(int)loggingContext; 42 | 43 | @end 44 | 45 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 46 | #pragma mark - 47 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 48 | 49 | /** 50 | * This class provides a log formatter that filters log statements from a logging context on the blacklist. 51 | **/ 52 | @interface DDContextBlacklistFilterLogFormatter : NSObject 53 | 54 | - (id)init; 55 | 56 | - (void)addToBlacklist:(int)loggingContext; 57 | - (void)removeFromBlacklist:(int)loggingContext; 58 | 59 | - (NSArray *)blacklist; 60 | 61 | - (BOOL)isOnBlacklist:(int)loggingContext; 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Source/Vendor/CocoaLumberjack/DDASLLogger.m: -------------------------------------------------------------------------------- 1 | #import "DDASLLogger.h" 2 | 3 | #import 4 | 5 | /** 6 | * Welcome to Cocoa Lumberjack! 7 | * 8 | * The project page has a wealth of documentation if you have any questions. 9 | * https://github.com/CocoaLumberjack/CocoaLumberjack 10 | * 11 | * If you're new to the project you may wish to read the "Getting Started" wiki. 12 | * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted 13 | **/ 14 | 15 | #if ! __has_feature(objc_arc) 16 | #warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). 17 | #endif 18 | 19 | 20 | @implementation DDASLLogger 21 | 22 | static DDASLLogger *sharedInstance; 23 | 24 | /** 25 | * The runtime sends initialize to each class in a program exactly one time just before the class, 26 | * or any class that inherits from it, is sent its first message from within the program. (Thus the 27 | * method may never be invoked if the class is not used.) The runtime sends the initialize message to 28 | * classes in a thread-safe manner. Superclasses receive this message before their subclasses. 29 | * 30 | * This method may also be called directly (assumably by accident), hence the safety mechanism. 31 | **/ 32 | + (void)initialize 33 | { 34 | static BOOL initialized = NO; 35 | if (!initialized) 36 | { 37 | initialized = YES; 38 | 39 | sharedInstance = [[[self class] alloc] init]; 40 | } 41 | } 42 | 43 | + (instancetype)sharedInstance 44 | { 45 | return sharedInstance; 46 | } 47 | 48 | - (id)init 49 | { 50 | if (sharedInstance != nil) 51 | { 52 | return nil; 53 | } 54 | 55 | if ((self = [super init])) 56 | { 57 | // A default asl client is provided for the main thread, 58 | // but background threads need to create their own client. 59 | 60 | client = asl_open(NULL, "com.apple.console", 0); 61 | } 62 | return self; 63 | } 64 | 65 | - (void)logMessage:(DDLogMessage *)logMessage 66 | { 67 | NSString *logMsg = logMessage->logMsg; 68 | 69 | if (formatter) 70 | { 71 | logMsg = [formatter formatLogMessage:logMessage]; 72 | } 73 | 74 | if (logMsg) 75 | { 76 | const char *msg = [logMsg UTF8String]; 77 | 78 | int aslLogLevel; 79 | switch (logMessage->logFlag) 80 | { 81 | // Note: By default ASL will filter anything above level 5 (Notice). 82 | // So our mappings shouldn't go above that level. 83 | 84 | case LOG_FLAG_ERROR : aslLogLevel = ASL_LEVEL_ALERT; break; 85 | case LOG_FLAG_WARN : aslLogLevel = ASL_LEVEL_CRIT; break; 86 | case LOG_FLAG_INFO : aslLogLevel = ASL_LEVEL_ERR; break; 87 | case LOG_FLAG_DEBUG : aslLogLevel = ASL_LEVEL_WARNING; break; 88 | default : aslLogLevel = ASL_LEVEL_NOTICE; break; 89 | } 90 | 91 | asl_log(client, NULL, aslLogLevel, "%s", msg); 92 | } 93 | } 94 | 95 | - (NSString *)loggerName 96 | { 97 | return @"cocoa.lumberjack.aslLogger"; 98 | } 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Tests/Shared/GCDAsyncSocketConnectionTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // GCDAsyncSocketConnectionTests.m 3 | // GCDAsyncSocketConnectionTests 4 | // 5 | // Created by Christopher Ballinger on 10/31/14. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | @import CocoaAsyncSocket; 12 | 13 | static const uint16_t kTestPort = 30301; 14 | 15 | @interface GCDAsyncSocketConnectionTests : XCTestCase 16 | @property (nonatomic, strong) GCDAsyncSocket *clientSocket; 17 | @property (nonatomic, strong) GCDAsyncSocket *serverSocket; 18 | @property (nonatomic, strong) GCDAsyncSocket *acceptedServerSocket; 19 | 20 | @property (nonatomic, strong) XCTestExpectation *expectation; 21 | @end 22 | 23 | @implementation GCDAsyncSocketConnectionTests 24 | 25 | - (void)setUp { 26 | [super setUp]; 27 | // Put setup code here. This method is called before the invocation of each test method in the class. 28 | self.clientSocket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()]; 29 | self.serverSocket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()]; 30 | } 31 | 32 | - (void)tearDown { 33 | // Put teardown code here. This method is called after the invocation of each test method in the class. 34 | [super tearDown]; 35 | [self.clientSocket disconnect]; 36 | [self.serverSocket disconnect]; 37 | [self.acceptedServerSocket disconnect]; 38 | self.clientSocket = nil; 39 | self.serverSocket = nil; 40 | self.acceptedServerSocket = nil; 41 | } 42 | 43 | - (void)testFullConnection { 44 | NSError *error = nil; 45 | BOOL success = NO; 46 | success = [self.serverSocket acceptOnPort:kTestPort error:&error]; 47 | XCTAssertTrue(success, @"Server failed setting up socket on port %d %@", kTestPort, error); 48 | success = [self.clientSocket connectToHost:@"127.0.0.1" onPort:kTestPort error:&error]; 49 | XCTAssertTrue(success, @"Client failed connecting to up server socket on port %d %@", kTestPort, error); 50 | 51 | self.expectation = [self expectationWithDescription:@"Test Full Connection"]; 52 | [self waitForExpectationsWithTimeout:30 handler:^(NSError *error) { 53 | if (error) { 54 | NSLog(@"Error establishing test connection"); 55 | } 56 | }]; 57 | } 58 | 59 | #pragma mark GCDAsyncSocketDelegate methods 60 | 61 | /** 62 | * Called when a socket accepts a connection. 63 | * Another socket is automatically spawned to handle it. 64 | * 65 | * You must retain the newSocket if you wish to handle the connection. 66 | * Otherwise the newSocket instance will be released and the spawned connection will be closed. 67 | * 68 | * By default the new socket will have the same delegate and delegateQueue. 69 | * You may, of course, change this at any time. 70 | **/ 71 | - (void)socket:(GCDAsyncSocket *)sock didAcceptNewSocket:(GCDAsyncSocket *)newSocket { 72 | NSLog(@"didAcceptNewSocket %@ %@", sock, newSocket); 73 | self.acceptedServerSocket = newSocket; 74 | } 75 | 76 | /** 77 | * Called when a socket connects and is ready for reading and writing. 78 | * The host parameter will be an IP address, not a DNS name. 79 | **/ 80 | - (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(uint16_t)port { 81 | NSLog(@"didConnectToHost %@ %@ %d", sock, host, port); 82 | [self.expectation fulfill]; 83 | } 84 | 85 | 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/BonjourServer/BonjourServerAppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "BonjourServerAppDelegate.h" 2 | #import "GCDAsyncSocket.h" 3 | #import "DDLog.h" 4 | #import "DDTTYLogger.h" 5 | #import "DDASLLogger.h" 6 | 7 | // Log levels: off, error, warn, info, verbose 8 | static const int ddLogLevel = LOG_LEVEL_VERBOSE; 9 | 10 | 11 | @implementation BonjourServerAppDelegate 12 | 13 | @synthesize window; 14 | 15 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 16 | { 17 | // Configure logging framework 18 | 19 | [DDLog addLogger:[DDTTYLogger sharedInstance]]; 20 | [DDLog addLogger:[DDASLLogger sharedInstance]]; 21 | 22 | // Create our socket. 23 | // We tell it to invoke our delegate methods on the main thread. 24 | 25 | asyncSocket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()]; 26 | 27 | // Create an array to hold accepted incoming connections. 28 | 29 | connectedSockets = [[NSMutableArray alloc] init]; 30 | 31 | // Now we tell the socket to accept incoming connections. 32 | // We don't care what port it listens on, so we pass zero for the port number. 33 | // This allows the operating system to automatically assign us an available port. 34 | 35 | NSError *err = nil; 36 | if ([asyncSocket acceptOnPort:0 error:&err]) 37 | { 38 | // So what port did the OS give us? 39 | 40 | UInt16 port = [asyncSocket localPort]; 41 | 42 | // Create and publish the bonjour service. 43 | // Obviously you will be using your own custom service type. 44 | 45 | netService = [[NSNetService alloc] initWithDomain:@"local." 46 | type:@"_YourServiceName._tcp." 47 | name:@"" 48 | port:port]; 49 | 50 | [netService setDelegate:self]; 51 | [netService publish]; 52 | 53 | // You can optionally add TXT record stuff 54 | 55 | NSMutableDictionary *txtDict = [NSMutableDictionary dictionaryWithCapacity:2]; 56 | 57 | [txtDict setObject:@"moo" forKey:@"cow"]; 58 | [txtDict setObject:@"quack" forKey:@"duck"]; 59 | 60 | NSData *txtData = [NSNetService dataFromTXTRecordDictionary:txtDict]; 61 | [netService setTXTRecordData:txtData]; 62 | } 63 | else 64 | { 65 | DDLogError(@"Error in acceptOnPort:error: -> %@", err); 66 | } 67 | } 68 | 69 | - (void)socket:(GCDAsyncSocket *)sock didAcceptNewSocket:(GCDAsyncSocket *)newSocket 70 | { 71 | DDLogInfo(@"Accepted new socket from %@:%hu", [newSocket connectedHost], [newSocket connectedPort]); 72 | 73 | // The newSocket automatically inherits its delegate & delegateQueue from its parent. 74 | 75 | [connectedSockets addObject:newSocket]; 76 | } 77 | 78 | - (void)socketDidDisconnect:(GCDAsyncSocket *)sock withError:(NSError *)err 79 | { 80 | [connectedSockets removeObject:sock]; 81 | } 82 | 83 | - (void)netServiceDidPublish:(NSNetService *)ns 84 | { 85 | DDLogInfo(@"Bonjour Service Published: domain(%@) type(%@) name(%@) port(%i)", 86 | [ns domain], [ns type], [ns name], (int)[ns port]); 87 | } 88 | 89 | - (void)netService:(NSNetService *)ns didNotPublish:(NSDictionary *)errorDict 90 | { 91 | // Override me to do something here... 92 | // 93 | // Note: This method in invoked on our bonjour thread. 94 | 95 | DDLogError(@"Failed to Publish Service: domain(%@) type(%@) name(%@) - %@", 96 | [ns domain], [ns type], [ns name], errorDict); 97 | } 98 | 99 | @end 100 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/Wifi_Mac_Demo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/Wifi_iOS_Demo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/EchoServer/EchoServer.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/EchoServer.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/EchoServer/EchoServer.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/EchoServer.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Desktop/ConnectTest.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/ConnectTest.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/ConnectTest/Mobile/ConnectTest.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/ConnectTest.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/BonjourClient/BonjourClient.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/BonjourClient.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/BonjourServer/BonjourServer.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/BonjourServer.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/InterfaceTest/InterfaceTest.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/InterfaceTest.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/UdpEchoClient/UdpEchoClient.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/UdpEchoClient.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/RunLoop/UdpEchoServer/UdpEchoServer.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/UdpEchoServer.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Desktop/TestPreBuffer.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/TestPreBuffer.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/TestPreBuffer/Mobile/TestPreBuffer.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/TestPreBuffer.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Desktop/UdpEchoClient.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/UdpEchoClient.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoClient/Mobile/UdpEchoClient.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/UdpEchoClient.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoServer/Desktop/UdpEchoServer.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/UdpEchoServer.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/UdpEchoServer/Mobile/UdpEchoServer.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/UdpEchoServer.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Source/Vendor/CocoaLumberjack/Extensions/DDMultiFormatter.m: -------------------------------------------------------------------------------- 1 | #import "DDMultiFormatter.h" 2 | 3 | /** 4 | * Welcome to Cocoa Lumberjack! 5 | * 6 | * The project page has a wealth of documentation if you have any questions. 7 | * https://github.com/CocoaLumberjack/CocoaLumberjack 8 | * 9 | * If you're new to the project you may wish to read the "Getting Started" page. 10 | * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted 11 | **/ 12 | 13 | #if TARGET_OS_IPHONE 14 | // Compiling for iOS 15 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 // iOS 6.0 or later 16 | #define NEEDS_DISPATCH_RETAIN_RELEASE 0 17 | #else // iOS 5.X or earlier 18 | #define NEEDS_DISPATCH_RETAIN_RELEASE 1 19 | #endif 20 | #else 21 | // Compiling for Mac OS X 22 | #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later 23 | #define NEEDS_DISPATCH_RETAIN_RELEASE 0 24 | #else // Mac OS X 10.7 or earlier 25 | #define NEEDS_DISPATCH_RETAIN_RELEASE 1 26 | #endif 27 | #endif 28 | 29 | 30 | @interface DDMultiFormatter () 31 | 32 | - (DDLogMessage *)logMessageForLine:(NSString *)line originalMessage:(DDLogMessage *)message; 33 | 34 | @end 35 | 36 | 37 | @implementation DDMultiFormatter { 38 | dispatch_queue_t _queue; 39 | NSMutableArray *_formatters; 40 | } 41 | 42 | - (id)init { 43 | self = [super init]; 44 | if (self) { 45 | #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 46 | _queue = dispatch_queue_create("cocoa.lumberjack.multiformatter", DISPATCH_QUEUE_CONCURRENT); 47 | #else 48 | _queue = dispatch_queue_create("cocoa.lumberjack.multiformatter", NULL); 49 | #endif 50 | _formatters = [NSMutableArray new]; 51 | } 52 | 53 | return self; 54 | } 55 | 56 | #if NEEDS_DISPATCH_RETAIN_RELEASE 57 | - (void)dealloc { 58 | dispatch_release(_queue); 59 | } 60 | #endif 61 | 62 | #pragma mark Processing 63 | 64 | - (NSString *)formatLogMessage:(DDLogMessage *)logMessage { 65 | __block NSString *line = logMessage->logMsg; 66 | 67 | dispatch_sync(_queue, ^{ 68 | for (id formatter in _formatters) { 69 | DDLogMessage *message = [self logMessageForLine:line originalMessage:logMessage]; 70 | line = [formatter formatLogMessage:message]; 71 | 72 | if (!line) { 73 | break; 74 | } 75 | } 76 | }); 77 | 78 | return line; 79 | } 80 | 81 | - (DDLogMessage *)logMessageForLine:(NSString *)line originalMessage:(DDLogMessage *)message { 82 | DDLogMessage *newMessage = [message copy]; 83 | newMessage->logMsg = line; 84 | return newMessage; 85 | } 86 | 87 | #pragma mark Formatters 88 | 89 | - (NSArray *)formatters { 90 | __block NSArray *formatters; 91 | 92 | dispatch_sync(_queue, ^{ 93 | formatters = [_formatters copy]; 94 | }); 95 | 96 | return formatters; 97 | } 98 | 99 | - (void)addFormatter:(id)formatter { 100 | dispatch_barrier_async(_queue, ^{ 101 | [_formatters addObject:formatter]; 102 | }); 103 | } 104 | 105 | - (void)removeFormatter:(id)formatter { 106 | dispatch_barrier_async(_queue, ^{ 107 | [_formatters removeObject:formatter]; 108 | }); 109 | } 110 | 111 | - (void)removeAllFormatters { 112 | dispatch_barrier_async(_queue, ^{ 113 | [_formatters removeAllObjects]; 114 | }); 115 | } 116 | 117 | - (BOOL)isFormattingWithFormatter:(id)formatter { 118 | __block BOOL hasFormatter; 119 | 120 | dispatch_sync(_queue, ^{ 121 | hasFormatter = [_formatters containsObject:formatter]; 122 | }); 123 | 124 | return hasFormatter; 125 | } 126 | 127 | @end 128 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Desktop/SimpleHTTPClient.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/SimpleHTTPClient.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Examples/GCD/SimpleHTTPClient/Mobile/SimpleHTTPClient.xcodeproj/xcuserdata/yuedongkui.xcuserdatad/xcschemes/SimpleHTTPClient.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WifiDemo/Wifi_iOS_Demo/NSString+IP.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+IP.m 3 | // SmartFinder 4 | // 5 | // Created by yuedongkui on 2016/11/8. 6 | // Copyright © 2016年 Smartisan. All rights reserved. 7 | // 8 | 9 | #import "NSString+IP.h" 10 | #import 11 | #import 12 | 13 | 14 | @implementation NSString (IP) 15 | 16 | + (NSString *)getIpLocally:(NSString *)networkInterface ipVersion:(int)ipVersion 17 | { 18 | if(ipVersion != 4 && ipVersion != 6) 19 | { 20 | NSLog(@"getIpLocally unknown version of IP: %i",ipVersion); 21 | return nil; 22 | } 23 | 24 | NSString *networkInterfaceRef; 25 | 26 | if ([networkInterface isEqualToString: @"ios_cellular"]) 27 | { 28 | networkInterfaceRef = @"pdp_ip0"; 29 | } 30 | else if([networkInterface isEqualToString: @"ios_wifi"]) 31 | { 32 | networkInterfaceRef = @"en0"; //en1 on simulator if mac on wifi 33 | } 34 | else 35 | { 36 | NSLog(@"getIpLocally unknown interface: %@",networkInterface); 37 | return nil; 38 | } 39 | 40 | NSMutableArray *add = [NSMutableArray array]; 41 | NSString *address = nil; 42 | struct ifaddrs *interfaces = NULL; 43 | struct ifaddrs *temp_addr = NULL; 44 | struct sockaddr_in *s4; 45 | struct sockaddr_in6 *s6; 46 | char buf[64]; 47 | int success = 0; 48 | 49 | // retrieve the current interfaces - returns 0 on success 50 | success = getifaddrs(&interfaces); 51 | if (success == 0) 52 | { 53 | // Loop through linked list of interfaces 54 | temp_addr = interfaces; 55 | while(temp_addr != NULL) 56 | { 57 | if( (ipVersion == 4 && temp_addr->ifa_addr->sa_family == AF_INET) || 58 | (ipVersion == 6 && temp_addr->ifa_addr->sa_family == AF_INET6)) 59 | { 60 | NSLog(@"Network Interface: %@", [NSString stringWithUTF8String:temp_addr->ifa_name]); 61 | [add addObject:add]; 62 | 63 | if(ipVersion == 4) 64 | { 65 | s4 = (struct sockaddr_in *)temp_addr->ifa_addr; 66 | 67 | if (inet_ntop(temp_addr->ifa_addr->sa_family, (void *)&(s4->sin_addr), buf, sizeof(buf)) == NULL) 68 | { 69 | NSLog(@"%s: inet_ntop failed for v4!\n", temp_addr->ifa_name); 70 | } 71 | else{ 72 | NSString *newaddress = [NSString stringWithUTF8String:buf]; 73 | [add addObject:newaddress]; 74 | } 75 | } 76 | if (ipVersion == 6) 77 | { 78 | s6 = (struct sockaddr_in6 *)(temp_addr->ifa_addr); 79 | 80 | if (inet_ntop(temp_addr->ifa_addr->sa_family, (void *)&(s6->sin6_addr), buf, sizeof(buf)) == NULL) 81 | { 82 | NSLog(@"%s: inet_ntop failed for v6!\n",temp_addr->ifa_name); 83 | } 84 | else{ 85 | NSString *newaddress = [NSString stringWithUTF8String:buf]; 86 | [add addObject:newaddress]; 87 | } 88 | } 89 | 90 | 91 | // Check if interface is en0 which is the wifi connection on the iPhone 92 | if([[NSString stringWithUTF8String:temp_addr->ifa_name] isEqualToString:networkInterfaceRef]) 93 | { 94 | address = [add lastObject]; 95 | } 96 | } 97 | 98 | temp_addr = temp_addr->ifa_next; 99 | } 100 | } 101 | 102 | // Free memory 103 | freeifaddrs(interfaces); 104 | 105 | if (address ==nil) { 106 | address = [add lastObject]; 107 | } 108 | 109 | return address; 110 | } 111 | 112 | @end 113 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Tests/CocoaAsyncSocket.xcodeproj/xcshareddata/xcschemes/CocoaAsyncSocketTestsMac.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Tests/CocoaAsyncSocket.xcodeproj/xcshareddata/xcschemes/CocoaAsyncSocketTestsiOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /WifiDemo/WifiDemo/CocoaAsyncSocket/Source/Vendor/CocoaLumberjack/DDAbstractDatabaseLogger.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "DDLog.h" 4 | 5 | /** 6 | * Welcome to Cocoa Lumberjack! 7 | * 8 | * The project page has a wealth of documentation if you have any questions. 9 | * https://github.com/CocoaLumberjack/CocoaLumberjack 10 | * 11 | * If you're new to the project you may wish to read the "Getting Started" wiki. 12 | * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted 13 | * 14 | * 15 | * This class provides an abstract implementation of a database logger. 16 | * 17 | * That is, it provides the base implementation for a database logger to build atop of. 18 | * All that is needed for a concrete database logger is to extend this class 19 | * and override the methods in the implementation file that are prefixed with "db_". 20 | **/ 21 | 22 | @interface DDAbstractDatabaseLogger : DDAbstractLogger { 23 | @protected 24 | NSUInteger saveThreshold; 25 | NSTimeInterval saveInterval; 26 | NSTimeInterval maxAge; 27 | NSTimeInterval deleteInterval; 28 | BOOL deleteOnEverySave; 29 | 30 | BOOL saveTimerSuspended; 31 | NSUInteger unsavedCount; 32 | dispatch_time_t unsavedTime; 33 | dispatch_source_t saveTimer; 34 | dispatch_time_t lastDeleteTime; 35 | dispatch_source_t deleteTimer; 36 | } 37 | 38 | /** 39 | * Specifies how often to save the data to disk. 40 | * Since saving is an expensive operation (disk io) it is not done after every log statement. 41 | * These properties allow you to configure how/when the logger saves to disk. 42 | * 43 | * A save is done when either (whichever happens first): 44 | * 45 | * - The number of unsaved log entries reaches saveThreshold 46 | * - The amount of time since the oldest unsaved log entry was created reaches saveInterval 47 | * 48 | * You can optionally disable the saveThreshold by setting it to zero. 49 | * If you disable the saveThreshold you are entirely dependent on the saveInterval. 50 | * 51 | * You can optionally disable the saveInterval by setting it to zero (or a negative value). 52 | * If you disable the saveInterval you are entirely dependent on the saveThreshold. 53 | * 54 | * It's not wise to disable both saveThreshold and saveInterval. 55 | * 56 | * The default saveThreshold is 500. 57 | * The default saveInterval is 60 seconds. 58 | **/ 59 | @property (assign, readwrite) NSUInteger saveThreshold; 60 | @property (assign, readwrite) NSTimeInterval saveInterval; 61 | 62 | /** 63 | * It is likely you don't want the log entries to persist forever. 64 | * Doing so would allow the database to grow infinitely large over time. 65 | * 66 | * The maxAge property provides a way to specify how old a log statement can get 67 | * before it should get deleted from the database. 68 | * 69 | * The deleteInterval specifies how often to sweep for old log entries. 70 | * Since deleting is an expensive operation (disk io) is is done on a fixed interval. 71 | * 72 | * An alternative to the deleteInterval is the deleteOnEverySave option. 73 | * This specifies that old log entries should be deleted during every save operation. 74 | * 75 | * You can optionally disable the maxAge by setting it to zero (or a negative value). 76 | * If you disable the maxAge then old log statements are not deleted. 77 | * 78 | * You can optionally disable the deleteInterval by setting it to zero (or a negative value). 79 | * 80 | * If you disable both deleteInterval and deleteOnEverySave then old log statements are not deleted. 81 | * 82 | * It's not wise to enable both deleteInterval and deleteOnEverySave. 83 | * 84 | * The default maxAge is 7 days. 85 | * The default deleteInterval is 5 minutes. 86 | * The default deleteOnEverySave is NO. 87 | **/ 88 | @property (assign, readwrite) NSTimeInterval maxAge; 89 | @property (assign, readwrite) NSTimeInterval deleteInterval; 90 | @property (assign, readwrite) BOOL deleteOnEverySave; 91 | 92 | /** 93 | * Forces a save of any pending log entries (flushes log entries to disk). 94 | **/ 95 | - (void)savePendingLogEntries; 96 | 97 | /** 98 | * Removes any log entries that are older than maxAge. 99 | **/ 100 | - (void)deleteOldLogEntries; 101 | 102 | @end 103 | --------------------------------------------------------------------------------