Not without any code to see what you are doing.
- (void)changeLights
id)sender
{
int n;
char buffer[201];
struct sockaddr_in serverAddress;
char *achar = ">N,ON\n";
NSLog(@"%d", sockfd);
//NSFileHandle *fileHandle = [[NSFileHandle alloc] initWithFileDescriptor:sockfd];
bzero( &serverAddress, sizeof(serverAddress) );
serverAddress.sin_family = AF_INET;
serverAddress.sin_port = htons( 4999 );
inet_pton( AF_INET, "69.116.166.132", &serverAddress.sin_addr );
if(connect( sockfd, (struct sockaddr *)&serverAddress, sizeof(serverAddress)) < 0){
return;
}
if(lightSwitch.on){
achar = ">N,ON\n";
} else {
achar = ">N,OFF\n";
}
NSString *streamingString;
NSMutableString *finishedString = [[NSMutableString string] retain];
/*while ( n = read( sockfd, buffer, 200) ) {
buffer[n] = 0;
streamingString = [[NSString alloc] initWithCString:buffer];
[finishedString appendString:streamingString];
[streamingString release];
//printf( buffer );
}*/
testView.text = [[finishedString copy] retain];
[finishedString release];
//write( sockfd, achar, strlen(achar));
//close(sockfd);
}