请教,郁闷死了ios asyncsockett接收大的数据时就接收的不完整

CocoaAsyncSocket使用 - 王朝网络 -
分享&&&&&当前位置: &&&&&&&&CocoaAsyncSocket使用&&&  代理的.h文件  //GCDAsyncSocketDelegate执行代理对象#import&Foundation/Foundation.h&#import"CocoaAsyncSocket.h"#import"Public.h"typedefvoid(^DidReadData)(NSDictionary*didReadData);/**  *
GCDAsyncSocketDelegate执行代理对象*/@interface NSObjectGCDAsyncSocket : NSObject&GCDAsyncSocketDelegate&/**  *
接收到数据的处理*/@PRoperty(nonatomic,copy)DidReadData didReadD/**  *
发送的数据
如果添加新键值则需要先开辟内存*/@property(nonatomic,retain)NSMutableDictionary*writeD/**  *
发送链接请求*/-(BOOL)startC/**  *
单例*/+(NSObjectGCDAsyncSocket*)defaultS  @end  .m文件  ////NSObjectGCDAsyncSocket.m//attendance////Created by dgc on 15/7/7.//Copyright (c) 2015年 dgc. All rights reserved.//#import"NSObjectGCDAsyncSocket.h"@implementation NSObjectGCDAsyncSocket  {  
GCDAsyncSocket*  }/**  *
单例  *  *
@return*/+(NSObjectGCDAsyncSocket *)defaultSocket  {//socket只会实例化一次staticNSObjectGCDAsyncSocket* socket=//保证线程安全,defaultSocket只执行一次staticdispatch_once_  
dispatch_once(&once, ^{  
socket=[[NSObjectGCDAsyncSocket alloc] init];  
});  }/**  *
初始化  *  *  *
@return self*/-(instancetype)init  {  
self=[super init];if(self)  
socket=[[GCDAsyncSocket alloc] initWithDelegate:self  
delegateQueue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0)];  
}  }/**  *
发送链接请求*/-(BOOL)startConnect  {//先确定断开连接再开始链接if(socket.isConnected)  
NSLog(@"主动断开");  
[socket disconnect];  
NSError*  
isSuccess=[socket connectToHost:SocketHost  
onPort:SocketPort  
error:&error];if(error)  
NSLog(@"error.localizedDescription:%@",error.localizedDescription);  
}returnisS  
  }#pragmamark - GCDAsyncSocketDelegate/**  *
链接成功  *  *
@param sock sock实例  *
@param host IP  *
@param port 端口*/-(void)socket:(GCDAsyncSocket *)sock  didConnectToHost:(NSString*)host  
port:(uint16_t)port  {//NSLog(@"%s",__FUNCTION__);//NSLog(sock.isConnected?@"YES":@"NO");//if (sock.isConnected)//{//nsstring上传需要加"\n"分隔符方可上传成功/*[sock writeData:[@"ABCABCABCABCABCABC\n" dataUsingEncoding:NSUTF8StringEncoding]  withTimeout:-1  tag:0];*//*NSDictionary* nsDictionaryUser=@{@"gpsinfo":@"Gpsinfo",  @"pswd":self.passWord,  @"gpstype":@(2015),  @"name":self.name,  };  
NSDictionary* agrement=@{@"vertion":@(1),  
@"type1":@(2),  
@"type2":@(0),  
@"type3":@(0)};*/if([NSJSONSerialization isValidJSONObject:self.writeData])  
{//NSLog(@"isValidJSONObject");NSError*//先转nsdata再转nsstring是为了保证nsdictionary格式不变NSData *nsDataUser=[NSJSONSerialization dataWithJSONObject:self.writeData  
options:NSJSONWritingPrettyPrinted  
error:&error];  
NSString* json=[[NSString alloc] initWithData:nsDataUser  
encoding:NSUTF8StringEncoding];//NSLog(@"nsDictionaryUser:%@",json);json=[json stringByReplacingOccurrencesOfString:@"\n"withString:@""];  
json=[json stringByReplacingOccurrencesOfString:@""withString:@""];  
json=[json stringByAppendingString:@"\n"];//NSLog(@"json:%@",json);[sock writeData:[json dataUsingEncoding:NSUTF8StringEncoding]  
withTimeout:-1tag:0];//保持读取的长连接[sock readDataWithTimeout:-1tag:0];if(error)  
NSLog(@"localizedDescription:%@",[error localizedDescription]);  
NSLog(@"localizedFailureReason:%@",[error localizedFailureReason]);  
}//}}/**  *
发送数据成功  *  *
@param sock
sock实例  *
@param tag
标记sock*/-(void)socket:(GCDAsyncSocket *)sock  didWriteDataWithTag:(long)tag  {//NSLog(@"didWriteDataWithTag");}/**  *
已经获取到数据  *  *
@param sock sock实例  *
@param data 获取到的数据  *
@param tag
标记sock*/-(void)socket:(GCDAsyncSocket *)sock   didReadData:(NSData*)data  
withTag:(long)tag  {//NSLog(@"%s",__FUNCTION__);NSError* error=  
NSDictionary* json=(NSDictionary*)[NSJSONSerialization JSONObjectWithData:data  
options:NSJSONReadingAllowFragments  
error:&error];  
NSLog([NSJSONSerialization isValidJSONObject:json]?@"is ValidJSONObject":@"is't ValidJSONObject");if(error)  
NSLog(@"socketError1:%@",[error localizedDescription]);  
NSLog(@"socketError2:%@",[error localizedFailureReason]);  
self.didReadData(json);  
[sock disconnect];  
  }/**  *
链接出错  *  *
@param sock sock实例  *
@param err
错误参数*/-(void)socketDidDisconnect:(GCDAsyncSocket *)sock  
withError:(NSError*)err  {//NSLog(@"%s",__FUNCTION__);if(err)  
NSLog(@"socketDidDisconnect:%@",[err localizedDescription]);  
NSLog(@"socketDidDisconnect:%@",[err localizedFailureReason]);  
}//self.didReadData(nil);}  @end  使用  创建对象  
socket=[NSObjectGCDAsyncSocket defaultSocket];  填写发送的数据  socket.writeData=[NSMutableDictionary dictionaryWithDictionary:dictionary];  处理收到的数据  
socket.didReadData=^(NSDictionary*didReadData){.......}开始链接  [socket startConnect];&&&&&今日推荐
&&&&&老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...把牛仔裤磨出有线的破洞
1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...先来看下敬业福和爱国福
今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。
今天该活动正式启动,和去年一样,需要收集“五福”...有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。
1、很多人有这种习...简介
《极品家丁》讲述了现代白领林晚荣无意回到古代金陵,并追随萧二小姐化名“林三”进入萧府,不料却阴差阳错上演了一出低级家丁拼搏上位的“林三升职记”。...你就是我最爱的宝宝 - 李溪芮
(电视剧《极品家丁》片尾曲)
作词:常馨内
作曲:常馨内
你的眉 又鬼马的挑
你的嘴 又坏坏的笑
上一秒吵闹 下...乌梅,又称春梅,中医认为,乌梅味酸,性温,无毒,具有安心、除热、下气、祛痰、止渴调中、杀虫的功效,治肢体痛、肺痨病。乌梅泡水喝能治伤寒烦热、止吐泻,与干姜一起制...什么是脂肪粒
在我们的脸上总会长一个个像脂肪的小颗粒,弄也弄不掉,而且颜色还是白白的。它既不是粉刺也不是其他的任何痘痘,它就是脂肪粒。
脂肪粒虽然也是由油脂...来源:中国青年报
新的攻击方法不断涌现,黑客几乎永远占据网络攻击的上风,我们不可能通过技术手段杜绝网络攻击。国家安全保障的主要方向是打击犯罪,而不是处置和惩罚...夫妻网络直播“造人”爆红
  1月9日,温岭城北派出所接到南京警方的协查通告,他们近期打掉了一个涉黄直播APP平台。而根据掌握的线索,其中有一对涉案的夫妻主播...如何防止墙纸老化?
(1)选择透气性好的墙纸
市场上墙纸的材质分无纺布的、木纤维的、PVC的、玻璃纤维基材的、布面的等,相对而言,PVC材质的墙纸最不透气...观点一:破日本销售量的“鲜肌之谜” 非日本生产
近一段时间,淘宝上架了一款名为“鲜肌之谜的” 鲑鱼卵巢美容液,号称是最近日本的一款推出的全新护肤品,产品本身所...系腰裙(北宋词人 张先)
惜霜蟾照夜云天,朦胧影、画勾阑。人情纵似长情月,算一年年。又能得、几番圆。
欲寄西江题叶字,流不到、五亭前。东池始有荷新绿,尚小如...关于女人的经典语句1、【做一个独立的女人】
思想独立:有主见、有自己的人生观、价值观。有上进心,永远不放弃自己的理想,做一份自己喜爱的事业,拥有快乐和成就...你想体验机器人性爱吗?你想和性爱机器人结婚吗?如果你想,机器人有拒绝你的权利吗?
近日,第二届“国际人类-机器人性爱研讨会”大会在伦敦金史密斯大学落下帷幕。而...10.土耳其地下洞穴城市
变态指数:★★☆☆☆
这是土耳其卡帕多西亚的一个著名景点,传说是当年基督教徒们为了躲避战争而在此修建。里面曾住着20000人,......据英国《每日快报》报道,一位科学家兼理论家Robert Lanza博士宣称,世界上并不存在人类死亡,死亡的只是身体。他认为我们的意识借助我们体内的能量生存,而且...《我爱狐狸精》 - 刘馨棋
  (电视剧《屏里狐》主题曲)
  作词:金十三&李旦
  作曲:刘嘉
  狐狸精 狐狸仙
  千年修... under pass
自由人非常擅长传球和垫球。
The libero is very go...·&·&·&&&&&&代理的.h文件
//GCDAsyncSocketDelegate执行代理对象#import&Foundation/Foundation.h&#import"CocoaAsyncSocket.h"#import"Public.h"typedefvoid(^DidReadData)(NSDictionary*didReadData);/**
GCDAsyncSocketDelegate执行代理对象*/@interface NSObjectGCDAsyncSocket : NSObject&GCDAsyncSocketDelegate&/**
接收到数据的处理*/@PRoperty(nonatomic,copy)DidReadData didReadD/**
发送的数据
如果添加新键值则需要先开辟内存*/@property(nonatomic,retain)NSMutableDictionary*writeD/**
发送链接请求*/-(BOOL)startC/**
单例*/+(NSObjectGCDAsyncSocket*)defaultS
////NSObjectGCDAsyncSocket.m//attendance////Created by dgc on 15/7/7.//Copyright (c) 2015年 dgc. All rights reserved.//#import"NSObjectGCDAsyncSocket.h"@implementation NSObjectGCDAsyncSocket
GCDAsyncSocket*
@return*/+(NSObjectGCDAsyncSocket *)defaultSocket
{//socket只会实例化一次staticNSObjectGCDAsyncSocket* socket=//保证线程安全,defaultSocket只执行一次staticdispatch_once_
dispatch_once(&once, ^{
socket=[[NSObjectGCDAsyncSocket alloc] init];
@return self*/-(instancetype)init
self=[super init];if(self)
socket=[[GCDAsyncSocket alloc] initWithDelegate:self
delegateQueue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0)];
发送链接请求*/-(BOOL)startConnect
{//先确定断开连接再开始链接if(socket.isConnected)
NSLog(@"主动断开");
[socket disconnect];
isSuccess=[socket connectToHost:SocketHost
onPort:SocketPort
error:&error];if(error)
NSLog(@"error.localizedDescription:%@",error.localizedDescription);
}returnisS
}#pragmamark - GCDAsyncSocketDelegate/**
@param sock sock实例
@param host IP
@param port 端口*/-(void)socket:(GCDAsyncSocket *)sock
didConnectToHost:(NSString*)host
port:(uint16_t)port
{//NSLog(@"%s",__FUNCTION__);//NSLog(sock.isConnected?@"YES":@"NO");//if (sock.isConnected)//{//nsstring上传需要加"\n"分隔符方可上传成功/*[sock writeData:[@"ABCABCABCABCABCABC\n" dataUsingEncoding:NSUTF8StringEncoding]
withTimeout:-1
tag:0];*//*NSDictionary* nsDictionaryUser=@{@"gpsinfo":@"Gpsinfo",
@"pswd":self.passWord,
@"gpstype":@(2015),
@"name":self.name,
NSDictionary* agrement=@{@"vertion":@(1),
@"type1":@(2),
@"type2":@(0),
@"type3":@(0)};*/if([NSJSONSerialization isValidJSONObject:self.writeData])
{//NSLog(@"isValidJSONObject");NSError*//先转nsdata再转nsstring是为了保证nsdictionary格式不变NSData *nsDataUser=[NSJSONSerialization dataWithJSONObject:self.writeData
options:NSJSONWritingPrettyPrinted
error:&error];
NSString* json=[[NSString alloc] initWithData:nsDataUser
encoding:NSUTF8StringEncoding];//NSLog(@"nsDictionaryUser:%@",json);json=[json stringByReplacingOccurrencesOfString:@"\n"withString:@""];
json=[json stringByReplacingOccurrencesOfString:@""withString:@""];
json=[json stringByAppendingString:@"\n"];//NSLog(@"json:%@",json);[sock writeData:[json dataUsingEncoding:NSUTF8StringEncoding]
withTimeout:-1tag:0];//保持读取的长连接[sock readDataWithTimeout:-1tag:0];if(error)
NSLog(@"localizedDescription:%@",[error localizedDescription]);
NSLog(@"localizedFailureReason:%@",[error localizedFailureReason]);
发送数据成功
@param sock
@param tag
标记sock*/-(void)socket:(GCDAsyncSocket *)sock
didWriteDataWithTag:(long)tag
{//NSLog(@"didWriteDataWithTag");}/**
已经获取到数据
@param sock sock实例
@param data 获取到的数据
@param tag
标记sock*/-(void)socket:(GCDAsyncSocket *)sock
didReadData:(NSData*)data
withTag:(long)tag
{//NSLog(@"%s",__FUNCTION__);NSError* error=
NSDictionary* json=(NSDictionary*)[NSJSONSerialization JSONObjectWithData:data
options:NSJSONReadingAllowFragments
error:&error];
NSLog([NSJSONSerialization isValidJSONObject:json]?@"is ValidJSONObject":@"is't ValidJSONObject");if(error)
NSLog(@"socketError1:%@",[error localizedDescription]);
NSLog(@"socketError2:%@",[error localizedFailureReason]);
self.didReadData(json);
[sock disconnect];
@param sock sock实例
@param err
错误参数*/-(void)socketDidDisconnect:(GCDAsyncSocket *)sock
withError:(NSError*)err
{//NSLog(@"%s",__FUNCTION__);if(err)
NSLog(@"socketDidDisconnect:%@",[err localizedDescription]);
NSLog(@"socketDidDisconnect:%@",[err localizedFailureReason]);
}//self.didReadData(nil);}
socket=[NSObjectGCDAsyncSocket defaultSocket];
填写发送的数据
socket.writeData=[NSMutableDictionary dictionaryWithDictionary:dictionary];
处理收到的数据
socket.didReadData=^(NSDictionary*didReadData){.......}开始链接
[socket startConnect];&&&&&  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。&&&&&&为你推荐&&&&&&转载本文&UBB代码&HTML代码复制到剪贴板...&更多内容··········&&&&&&&&&频道精选&&&王朝女性&&|&&|&&|&&|&&|&&|&&|&&|&&|&&|&&|&&|&王朝分栏&&|&&|&&|&&|&&|&&|&&|&&|&&|&&|&王朝编程&&|&&|&&|&&|&&|&&|&&|&&|&&|&&|&王朝导购&&|&&|&&|&&|&&|&&|&&|&&|&&|&&|&王朝其他&&|&&|&&|&&|&&|&&|&&&&2005-&&版权所有&温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
阅读(5919)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
在LOFTER的更多文章
loftPermalink:'',
id:'fks_',
blogTitle:'CocoaAsyncSocket使用笔记',
blogAbstract:'最近要最ios的客户端,采用socket来连接服务器。本想自己写cfnetwork。但找了一些资料,看着就头大,正好看到这个框架。先去github的网站下载最新的包,然后先看看介绍。写的比较详细了',
blogTag:'',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:6,
publishTime:6,
permalink:'blog/static/',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'',
hmcon:'0',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}主题 : Asyncsocket接收数据的问题
级别: 新手上路
UID: 206951
可可豆: 58 CB
威望: 40 点
在线时间: 11(时)
发自: Web Page
Asyncsocket接收数据的问题&&&
技术问题发到问答:我知道,我仍旧要在论坛继续发布问题
我在- (void)viewDidLoad中写
[self.myDelegate.messageSocket.messageSocket setDelegate:self];
&&&&[self requestStudentInfo];
&&&&while (!readed) {
&&&&&&&&[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
&&&&NSLog(@&%ld!!!!!!!!!%@&, timeStamp, msg);
&&&&readed = NO;
&&&&//[self recivedStudentInfo];
&&&&[self requestRoomList:@&1&];
&&&&while (!readed) {
&&&&&&&&[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
&&&&NSLog(@&%ld#####%@&, timeStamp, msg);
希望一次数据发送后接收处理完再发第二条两个发送的方法是
- (void)requestRoomList:(NSString *)_repairType
&&&&action = @&repairFormList&;
&&&&NSDate *now = [NSDate date];
&&&&timeStamp = 1;
&&&&BIDProUtil *proUtil = [[BIDProUtil alloc] init];
&&&&[self.myDelegate.messageSocket.messageSocket writeData:[proUtil repairFormList:self.myDelegate.loginUser.userId hotelRoomId:@&1& userType:self.myDelegate.loginUser.userType repairType:_repairType] withTimeout:-1 tag:timeStamp];
- (void)requestStudentInfo
&&&&action = @&requestStudentInfo&;
&&&&NSDate *now = [NSDate date];
&&&&timeStamp = 0;
&&&&BIDProUtil *proUtil = [[BIDProUtil alloc] init];
&&&&[self.myDelegate.messageSocket.messageSocket writeData:[proUtil requestStudentInfo:self.myDelegate.loginUser.userId] withTimeout:-1 tag:timeStamp];
第一次进入这个view是正常的数据是 15:34:44.422 Report[] -[BIDProUtil requestStudentInfo:] 32, msg = start&&1.0.0&&studentInfo&&request&&12&&1&&12&&eof 15:34:44.424 Report[] 发送消息数据0 15:34:44.460 Report[] 准备接受数据 15:34:44.462 Report[!!!!!!!!!start&&1.0.0&&12&&1&&[{&floor_name&:&1#&,&room_name&:&1#101&,&roomfloor&:1,&bed_node&:&A&,&student_name&:&林若凡&,&phone&:&&,&hotel_room_id&:1}]&&1&&eof 15:34:44.464 Report[] -[BIDProUtil repairFormList:hotelRoomId:userType:repairType:] 39, msg = start&&1.0.0&&repairFormList&&request&&12&&1&&1%%1%%1&&eof 15:34:44.465 Report[] 发送消息数据1 15:34:44.561 Report[] 准备接受数据 15:34:44.564 Report[#####start&&1.0.0&&12&&1&&[{&repairformid&:68,&repairnum&:&BX14&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:67,&repairnum&:&BX50&,&roomname&:&1#101&,&itempname&:&电灯&,&itemname&:&d&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:66,&repairnum&:&BX10&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:65,&repairnum&:&BX33&,&roomname&:&1#101&,&itempname&:&电灯&,&itemname&:&闪光&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:64,&repairnum&:&BX16&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:63,&repairnum&:&BX33&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:62,&repairnum&:&BX17&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:61,&repairnum&:&BX31&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformi当我用UINavigationController返回再进入时,数据就反过来了 发送和接收的不对应了 15:36:24.825 Report[] -[BIDProUtil requestStudentInfo:] 32, msg = start&&1.0.0&&studentInfo&&request&&12&&1&&12&&eof 15:36:24.826 Report[] 发送消息数据0 15:36:24.828 Report[] 准备接受数据 15:36:24.829 Report[!!!!!!!!!d&:60,&repairnum&:&BX11&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:58,&repairnum&:&BX27&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:57,&repairnum&:&BX14&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法\345\212\240热&,&starttime&:0,&statusname&:&维修&,&status&:&2&},{&repairformid&:55,&repairnum&:&BX45&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:54,&repairnum&:&BX57&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:53,&repairnum&:&BX25&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:52,&repairnum&:&BX34&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:50,&repairnum&:&BX13&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:49,&repairnum&:&BX52&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:46,&repairnum&:&BX43&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:44,&repairnum&:&BX23&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:43,&repairnum&:&BX23&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:40,&repairnum&:&BX45&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:35,&repairnum&:&BX08&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:33,&repairnum&:&BX13&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:31,&repairnum&:&BX40&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:27,&repairnum&:&BX15&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:26,&repairnum&:&BX02&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:25,&repairnum&:&BX43&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:24,&repairnum&:&BX39&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&\346\227\240法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:23,&repairnum&:&BX33&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:22,&repairnum&:&BX39&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:21,&repairnum&:&BX42&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:17,&repairnum&:&BX48&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:16,&repairnum&:&BX30&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:15,&repairnum&:&BX12&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&水龙头坏了&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:10,&repairnum&:&BX48&,&roomname&:&1#101&,&itempname&:&电灯&,&itemname&:&闪光&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:9,&repairnum&:&BX02&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:8,&repairnum&:&BX47&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&完成&,&status&:&3&},{&repairformid&:4,&repairnum&:&BX7&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&完成&,&status&:&3&},{&repairformid&:2,&repairnum&:&BX27&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&待修&,&status&:&1&},{&repairformid&:5,&repairnum&:&BX4&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&完成&,&status&:&3&},{&repairformid&:3,&repairnum&:&BX46&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&完成&,&status&:&3&},{&repairformid&:6,&repairnum&:&BX9&,&roomname&:&1#101&,&itempname&:&热水器&,&itemname&:&无法加热&,&starttime&:0,&statusname&:&完成&,&status&:&3&}]&&1&&eof 15:36:24.837 Report[] -[BIDProUtil repairFormList:hotelRoomId:userType:repairType:] 39, msg = start&&1.0.0&&repairFormList&&request&&12&&1&&1%%1%%1&&eof 15:36:24.838 Report[] 发送消息数据1 15:36:24.882 Report[] 准备接受数据 15:36:24.884 Report[#####start&&1.0.0&&12&&1&&[{&floor_name&:&1#&,&room_name&:&1#101&,&roomfloor&:1,&bed_node&:&A&,&student_name&:&林若凡&,&phone&:&&,&hotel_room_id&:1}]&&1&&eof附上两个委托方法;
//发送完成处理
- (void)onSocket:(AsyncSocket *)sock didWriteDataWithTag:(long)tag
&&&&NSLog(@&发送消息数据%ld&, timeStamp);
&&&&[sock readDataWithTimeout: -1 tag: timeStamp];
//处理接受数据
- (void)onSocket:(AsyncSocket *)sock didReadData:(NSData *)data withTag:(long)tag
&&&&NSLog(@&准备接受数据&);
&&&&msg = [[NSString alloc] initWithBytes:[data bytes] length:[data length] encoding:NSUTF8StringEncoding];
&&&&readed = YES;
请各位前辈帮帮忙
级别: 精灵王
UID: 124167
发帖: 1946
可可豆: 2738 CB
威望: 5099 点
在线时间: 1345(时)
发自: Web Page
返回时socket有没有setDelegate为nil 和 release socket呢?
关注本帖(如果有新回复会站内信通知您)
苹果公司现任CEO是谁?2字 正确答案:库克
发帖、回帖都会得到可观的积分奖励。
按"Ctrl+Enter"直接提交
关注CocoaChina
关注微信 每日推荐
扫一扫 浏览移动版

我要回帖

更多关于 asyncsocket github 的文章

 

随机推荐