Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

More NetSocket problems...



Ok, got my NSFileHandles to work, over to my next problem :(

My program is sending and the other one is recieving and everything is a-ok :D
BUT... if I just nudge my mouse or do anything on my sending computer the socket disconnects...
The filetransfer takes all of my CPU it can... not good :/

This is how I did but i dont know if its the best way (probobly not):

- (void)netsocketDataSent:(NetSocket*)inNetSocket
{
NSLog(@"Data sent");
[self sendFile];
}

-(void)sendFile
{
NSData *readData;
readData = [outgoingHandle readDataOfLength:1024*16];


[transferSocket writeData:readData];
}

-(id)init
{
outgoingHandle = [[NSFileHandle fileHandleForReadingAtPath:@"Filename"] retain];
}

Anyone know what to do about this? The netsocket uses currentRunloop, maybe its that?
I really dont know what to do about this problem :(

André
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.