Commit 8071add9 by zhangyunjie

测试

parent c75912ff
......@@ -11,7 +11,7 @@
A9661B5324EA64F20024EB54 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A9661B5124EA64F20024EB54 /* LaunchScreen.storyboard */; };
A9661B5624EA64F20024EB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A9661B5524EA64F20024EB54 /* main.m */; };
A9661B6024EA72900024EB54 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A9661B5E24EA72900024EB54 /* AppDelegate.m */; };
A9661B6124EA72900024EB54 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9661B5F24EA72900024EB54 /* ViewController.m */; };
A9661B6124EA72900024EB54 /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9661B5F24EA72900024EB54 /* ViewController.mm */; };
A9661B6424EA729A0024EB54 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A9661B6224EA729A0024EB54 /* Main.storyboard */; };
A9661FCD24EA7AD10024EB54 /* CJLoadingView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9661F8324EA7AD10024EB54 /* CJLoadingView.m */; };
A9661FCE24EA7AD10024EB54 /* SDTool.m in Sources */ = {isa = PBXBuildFile; fileRef = A9661F8424EA7AD10024EB54 /* SDTool.m */; };
......@@ -270,8 +270,8 @@
A9D1B64124FE765F000F4662 /* ZYJQNIP.m in Sources */ = {isa = PBXBuildFile; fileRef = A9D1B5FC24FE765F000F4662 /* ZYJQNIP.m */; };
A9D1B64224FE765F000F4662 /* ZYJQNSystemTool.m in Sources */ = {isa = PBXBuildFile; fileRef = A9D1B60224FE765F000F4662 /* ZYJQNSystemTool.m */; };
A9D1B64524FE7D1F000F4662 /* AppDelegate+OffcnIMPush.m in Sources */ = {isa = PBXBuildFile; fileRef = A9D1B64424FE7D1F000F4662 /* AppDelegate+OffcnIMPush.m */; };
A9D1B64824FF6A66000F4662 /* oimcore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9D1B64624FF6A60000F4662 /* oimcore.framework */; };
A9D1B64924FF6A66000F4662 /* oimcore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A9D1B64624FF6A60000F4662 /* oimcore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
A9D1B64C24FF76FA000F4662 /* oimcore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9D1B64A24FF76F3000F4662 /* oimcore.framework */; };
A9D1B64D24FF76FA000F4662 /* oimcore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A9D1B64A24FF76F3000F4662 /* oimcore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
B94FCB1053F8932068A11CC9 /* libPods-OffcnIMSDKiOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 49CE5E230A14D9B821170F61 /* libPods-OffcnIMSDKiOS.a */; };
/* End PBXBuildFile section */
......@@ -282,7 +282,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
A9D1B64924FF6A66000F4662 /* oimcore.framework in Embed Frameworks */,
A9D1B64D24FF76FA000F4662 /* oimcore.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -300,7 +300,7 @@
A9661B5C24EA72900024EB54 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
A9661B5D24EA72900024EB54 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
A9661B5E24EA72900024EB54 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
A9661B5F24EA72900024EB54 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
A9661B5F24EA72900024EB54 /* ViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewController.mm; sourceTree = "<group>"; };
A9661B6324EA729A0024EB54 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
A9661F8324EA7AD10024EB54 /* CJLoadingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJLoadingView.m; sourceTree = "<group>"; };
A9661F8424EA7AD10024EB54 /* SDTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDTool.m; sourceTree = "<group>"; };
......@@ -844,7 +844,7 @@
A9D1B60524FE765F000F4662 /* ZYJQNUploadInfoReporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZYJQNUploadInfoReporter.h; sourceTree = "<group>"; };
A9D1B64324FE7D1F000F4662 /* AppDelegate+OffcnIMPush.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AppDelegate+OffcnIMPush.h"; sourceTree = "<group>"; };
A9D1B64424FE7D1F000F4662 /* AppDelegate+OffcnIMPush.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "AppDelegate+OffcnIMPush.m"; sourceTree = "<group>"; };
A9D1B64624FF6A60000F4662 /* oimcore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = oimcore.framework; sourceTree = "<group>"; };
A9D1B64A24FF76F3000F4662 /* oimcore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = oimcore.framework; sourceTree = "<group>"; };
D7DCDED1DEE7F99F223D5C73 /* Pods-OffcnIMSDKiOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OffcnIMSDKiOS.release.xcconfig"; path = "Target Support Files/Pods-OffcnIMSDKiOS/Pods-OffcnIMSDKiOS.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
......@@ -857,7 +857,7 @@
A96621F624EA84230024EB54 /* libsqlite3.tbd in Frameworks */,
A96621F524EA84160024EB54 /* libxml2.tbd in Frameworks */,
A96621EF24EA83A80024EB54 /* SystemConfiguration.framework in Frameworks */,
A9D1B64824FF6A66000F4662 /* oimcore.framework in Frameworks */,
A9D1B64C24FF76FA000F4662 /* oimcore.framework in Frameworks */,
A96621F124EA83B10024EB54 /* CoreTelephony.framework in Frameworks */,
B94FCB1053F8932068A11CC9 /* libPods-OffcnIMSDKiOS.a in Frameworks */,
);
......@@ -896,7 +896,7 @@
A9661B4224EA64EE0024EB54 /* OffcnIMSDKiOS */ = {
isa = PBXGroup;
children = (
A9D1B64624FF6A60000F4662 /* oimcore.framework */,
A9D1B64A24FF76F3000F4662 /* oimcore.framework */,
A9662CBF24ECD98B0024EB54 /* OffcnIMSDKiOS.entitlements */,
A966274724EBA36A0024EB54 /* ExposedInterface-(外放接口) */,
A9661FC824EA7AD10024EB54 /* Common-(宏) */,
......@@ -904,7 +904,7 @@
A9661B5C24EA72900024EB54 /* AppDelegate.h */,
A9661B5E24EA72900024EB54 /* AppDelegate.m */,
A9661B5D24EA72900024EB54 /* ViewController.h */,
A9661B5F24EA72900024EB54 /* ViewController.m */,
A9661B5F24EA72900024EB54 /* ViewController.mm */,
A9D1B33C24FE3BE6000F4662 /* OffcnIMSqliteTestVC.h */,
A9D1B33D24FE3BE6000F4662 /* OffcnIMSqliteTestVC.m */,
A9D1B32D24F7BE7B000F4662 /* OffcnZYJTestDataStorageView.h */,
......@@ -1996,7 +1996,7 @@
A9D1B61B24FE765F000F4662 /* ZYJQNInetAddress.m in Sources */,
A966218B24EA80A60024EB54 /* UIView+ZYJMJExtension.m in Sources */,
A9D1B32224F50973000F4662 /* OffcnIMModel.m in Sources */,
A9661B6124EA72900024EB54 /* ViewController.m in Sources */,
A9661B6124EA72900024EB54 /* ViewController.mm in Sources */,
A9D1B63424FE765F000F4662 /* ZYJQNALAssetFile.m in Sources */,
A9661FDC24EA7AD10024EB54 /* UIView+bezierShape.m in Sources */,
A966215224EA80A60024EB54 /* ZYJZYJFMDatabase.m in Sources */,
......
......@@ -202,6 +202,15 @@
<segue destination="2by-9C-78c" kind="push" id="fvn-k7-WRW"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hBY-Ug-jR2">
<rect key="frame" x="298" y="387" width="62" height="30"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="压测暂停"/>
<state key="selected" title="压测开始"/>
<connections>
<action selector="pressureTest:" destination="BYZ-38-t0r" eventType="touchUpInside" id="elf-4J-COs"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
......@@ -212,11 +221,13 @@
<constraint firstItem="bxC-wQ-owS" firstAttribute="top" secondItem="Cy1-S1-DPz" secondAttribute="top" id="6i3-87-Iqw"/>
<constraint firstItem="wpP-7X-EhS" firstAttribute="leading" secondItem="W7X-2X-xsv" secondAttribute="leading" id="7qR-05-4WU"/>
<constraint firstAttribute="trailing" secondItem="so4-rI-aRi" secondAttribute="trailing" id="83W-xz-1xP"/>
<constraint firstAttribute="trailing" secondItem="hBY-Ug-jR2" secondAttribute="trailing" constant="15" id="8L6-lm-ovv"/>
<constraint firstItem="wpP-7X-EhS" firstAttribute="top" secondItem="8TM-yv-Un7" secondAttribute="bottom" constant="5" id="8Ny-K1-4n7"/>
<constraint firstItem="Cy1-S1-DPz" firstAttribute="height" secondItem="dRe-f0-gnl" secondAttribute="height" id="8qa-si-8ig"/>
<constraint firstItem="m3k-LM-GSV" firstAttribute="leading" secondItem="dRe-f0-gnl" secondAttribute="leading" id="97H-yt-Mwa"/>
<constraint firstItem="dRe-f0-gnl" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="15" id="A4C-6b-WCr"/>
<constraint firstItem="so4-rI-aRi" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="Acv-YJ-6xY"/>
<constraint firstItem="hBY-Ug-jR2" firstAttribute="top" secondItem="0ox-b2-eLv" secondAttribute="bottom" constant="10" id="Ahq-wn-M6U"/>
<constraint firstItem="dRe-f0-gnl" firstAttribute="top" secondItem="wpP-7X-EhS" secondAttribute="bottom" constant="5" id="AvN-lQ-0c4"/>
<constraint firstItem="wpP-7X-EhS" firstAttribute="height" secondItem="W7X-2X-xsv" secondAttribute="height" id="DSG-sD-qXE"/>
<constraint firstItem="8TM-yv-Un7" firstAttribute="height" secondItem="W7X-2X-xsv" secondAttribute="height" id="FsK-4W-A58"/>
......
//
//
......@@ -64,7 +64,7 @@ static OffcnIMSocketManager *socketManager;
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
[dic setObjectOnSafe:@"39.102.42.185" forKey:@"server_ip"];
[dic setObjectOnSafe:[NSNumber numberWithInteger:1281] forKey:@"server_port"];
[dic setObjectOnSafe:[NSNumber numberWithInteger:1280] forKey:@"server_port"];
[dic setObjectOnSafe:account_id forKey:@"account_id"];
[dic setObjectOnSafe:@"offcn_live" forKey:@"app_id"];
[dic setObjectOnSafe:@"ios" forKey:@"device_type"];
......@@ -72,7 +72,7 @@ static OffcnIMSocketManager *socketManager;
NSString *session_id = [SDGeneralTool getNowSSSTimeTimestamp];
[dic setObjectOnSafe:session_id forKey:@"session_id"];
[dic setObjectOnSafe:@"kcp" forKey:@"connection_type"];
[dic setObjectOnSafe:@"websocket" forKey:@"connection_type"];
[dic setObjectOnSafe:@"disable" forKey:@"tls"];
[self connectIMServerWithParam:[dic mj_ZYJJSONString]];
......
......@@ -25,6 +25,8 @@
@property (nonatomic, strong) UIImage *pickImage;
@property (weak, nonatomic) IBOutlet UIImageView *showImage;
@property (nonatomic, strong) NSTimer *timer;//压测
@end
@implementation ViewController
......@@ -42,8 +44,27 @@
self.fromId = self.sendIDTextField.text;
self.toId = self.recvIDTextField.text;
if(!self.timer) {
self.timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(loop) userInfo:nil repeats:YES];
}
[self.timer setFireDate:[NSDate distantFuture]];
}
-(void)loop{
NSString *randomStr = [NSString stringWithFormat:@"%d",arc4random_uniform(1000000)];
[[OffcnIMSDKiOS defaultService] sendMsgWithMsg_fromID:self.fromId msg_toID:self.toId msg_type:OffcnSDKMsgTypeText text:randomStr filePath:nil Finished:^(BOOL success, OffcnIMSendMsgModel *sendMsgModel, NSString *errorMessage) {
if (success) {
NSLog(@"发送消息成功,消息:%@",randomStr);
}else{
NSLog(@"发送消息失败,消息:%@,errorMessage:%@",randomStr,errorMessage);
}
} ProgressPercent:^(NSString *key, float percent) {
NSLog(@"key == %@,percent == %.2f", key,percent);
}];
}
#pragma mark - 切换环境
- (IBAction)clickChangeEnvironmentBtnAction:(UIButton *)sender {
sender.selected = !sender.isSelected;
......@@ -64,7 +85,7 @@
__weak typeof(self) weakSelf = self;
[OffcnIMSocketManager defaultService].connectReceiveMessage = ^(OffcnIMModel *IMModel) {
NSLog(@"收到消息---%@",IMModel.body.msg.msg);
NSLog(@"收到消息---%@,时间:%@",IMModel.body.msg.msg,IMModel.body.send_time);
NSString *msg = @"";
if (IMModel.body.msg_type == 1) {
msg = [msg stringByAppendingString:IMModel.body.msg.msg?IMModel.body.msg.msg:@"nil"];
......@@ -290,6 +311,15 @@
NSLog(@"key == %@,percent == %.2f", key,percent);
}];
}
- (IBAction)pressureTest:(UIButton *)sender {
sender.selected = !sender.isSelected;
if (sender.isSelected) {
[self.timer setFireDate:[NSDate distantPast]];
}else{
[self.timer setFireDate:[NSDate distantFuture]];
}
}
#pragma mark UIImagePickerControllerDelegate
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment