• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
UDP sockets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: New Spotlight Info
  • Next by Date: Re: performSelector and subclassing
  • Previous by thread: Re: Best way to catch signals in a Cocoa app
  • Next by thread: Re: File Converting
  • Index(es):
    • Date
    • Thread