创建 oob 消息失败?

发布于 2024-09-07 08:08:16 字数 918 浏览 5 评论 0原文

你好,我正在尝试在两个 iPod Touch 之间构建一个简单的聊天客户端,作为学习 Bonjour 的开始。 我将两个设备连接得很好,一切似乎都应该正常工作。我可以毫无问题地发送数据(没有错误),但是当我应该接收数据时却没有。当我查看日志时,我看到“GCKSessionEvent_IncomingOOBPacket:无法创建 oob 消息”我尝试过 谷歌搜索该消息的每一段寻找答案,但实际上只有 0 个结果。我希望这里有人能给出答案。

感谢

KC

回复评论:

这三个电话是

-(IBAction)SendMessage
{   
NSData* aData = [[NSData alloc] initWithData:[typeText.text dataUsingEncoding: NSUTF8StringEncoding]];
    NSUTF8StringEncoding];
    [self sendDataToPeers:aData];
}

-(void)sendDataToPeers:(NSData*)data
{
    NSError* err;
    BOOL didSend = [self.mySession sendDataToAllPeers:data withDataMode:GKSendDataReliable error:&err];
}

-(void) receiveData:(NSData*)data fromPeer:(NSString*)peer inSession:(GKSession*)session context:(void*)context
{
    NSString* text = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]autorelease];
    self.displayText.text = text;
}

Hi I'm trying to build a simple chat client between two ipod touches Just as a start to learning Bonjour.
I connect the two devices fine and everything seems like it should work. I can send the data with no problems (no error) , but When I should then receive the data and I dont. When I look in the log, I see "GCKSessionEvent_IncomingOOBPacket: failed to create oob message" I've tried
Googling ever piece of that message looking for some answer but there are literally 0 results. I was hoping someone here might have an answer.

thanks

KC

Response to comment:

The three calls are

-(IBAction)SendMessage
{   
NSData* aData = [[NSData alloc] initWithData:[typeText.text dataUsingEncoding: NSUTF8StringEncoding]];
    NSUTF8StringEncoding];
    [self sendDataToPeers:aData];
}

-(void)sendDataToPeers:(NSData*)data
{
    NSError* err;
    BOOL didSend = [self.mySession sendDataToAllPeers:data withDataMode:GKSendDataReliable error:&err];
}

-(void) receiveData:(NSData*)data fromPeer:(NSString*)peer inSession:(GKSession*)session context:(void*)context
{
    NSString* text = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]autorelease];
    self.displayText.text = text;
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

森林散布 2024-09-14 08:08:21

我还在用 Wifi 和 GKSession 进行 iphone 到 iphone 的操作。在中止会话(又称为调试或崩溃)后,Bonjour(或 GKsessions)似乎感到困惑,同样的情况也发生在我身上。对于 OS 3.x,没有任何消息,只有挂起。在 OS 4.x 中,我收到消息“GCKSessionEvent_IncomingOOBPacket...”。我不知道这意味着什么,但重新启动 GKsession 或重新连接或有时只是等待解决问题。我怀疑由于对等点/接收器混乱,出站数据的缓冲区可能已满。

I am also doing iphone to iphone with Wifi and GKSession. After aborted sessions (aka debugging or crash) Bonjour (or GKsessions) seem to get confused and this same scenario happens to me. With OS 3.x there was no message, just the hang. With OS 4.x I get the message "GCKSessionEvent_IncomingOOBPacket...". I have no idea what this means, but restarting the GKsession or reconnecting or sometimes just waiting solve the problem. I suspect might be a buffer full on outbound data due to messed up peers/receivers.

零崎曲识 2024-09-14 08:08:21

Kendrick,假设您使用的是 4.0 SDK,那么您可能对此很满意。 GKSession 在 4.0 SDK 中存在许多最近引入的严重错误(崩溃、错误、缓慢)。此消息源自其中之一。我知道,因为当他们发布 4.0 时我正要提交我的 GameKit 应用程序,现在我正在等待 4.1,以便我可以提交它。 4.1 Beta 确实修复了许多此类问题,但遗憾的是,它仍然无法像 3.1.3 上那样工作。

Kendrick, assuming you are using the 4.0 SDK, then you may be SOL on this. GKSession has a number of show-stopper bugs in the 4.0 SDK (crashes, errors, slowness) that were introduced recently. This message is due to one of them. I know because I was about to submit my GameKit app when they released 4.0 and now I'm waiting for 4.1 so I can submit it. The 4.1 Beta does fix a number of these issues, but it still doesn't work the way it worked on 3.1.3, sadly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文