UDP sockets
UDP sockets
- Subject: UDP sockets
- From: jjoonathan <email@hidden>
- Date: Sun, 14 Nov 2004 16:47:39 -0700
I am using CFStream to make UDP connections. I can connect just fine, and (appearently) write just fine, but this read loop doesn't show anything:
{
NSAutoreleasePool *ar = [[NSAutoreleasePool alloc] init];
UInt8 buf[512];
NSString *str = [NSString string];
int rcvd = 0;
while (YES)
{
while (!opened || !CFReadStreamHasBytesAvailable(iStr)) {[NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:.05]];}
CFIndex bytesRead = CFReadStreamRead(iStr, buf, sizeof(buf));
str = [str stringByAppendingString:CFStringCreateWithBytes(kCFAllocatorDefault,buf,bytesRead,NO)];
[read setString:str];
}
[ar release];
}
What am I doing wrong?
jjoo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden