Browse files

added x86_64 build architecture and method to send messages synchrono…

…usly.
  • Loading branch information...
1 parent 93679e7 commit 23da4adcff92d98548b95104f634d2e4c105c84c Tim Burks committed Feb 23, 2010
Showing with 23 additions and 0 deletions.
  1. +2 −0 Nukefile
  2. +3 −0 example/Nukefile
  3. +18 −0 objc/NuSMTP.m
View
2 Nukefile
@@ -16,6 +16,8 @@
(set @framework "NuSMTP")
(set @framework_identifier "nu.programming.smtp")
(set @framework_creator_code "????")
+(set @arch (list "x86_64" "i386"))
+
(set @cflags "-g -fobjc-gc -std=gnu99 -I Source")
View
3 example/Nukefile
@@ -4,6 +4,9 @@
(set @nu_files (filelist "^nu/.*nu$"))
(set @resources (filelist "^resources/rule30.jpg$"))
+(set @arch (list "x86_64" "i386"))
+
+
;; application description
(set @application "SMTPTestApp")
(set @application_identifier "nu.programming.SMTPTestApp")
View
18 objc/NuSMTP.m
@@ -12,6 +12,7 @@
@interface NuSMTPMessage : NSObject <SKPSMTPMessageDelegate>
{
SKPSMTPMessage* msg;
+ int completed;
}
- (id) initWithFromEmail:(NSString*)fromEmail
@@ -42,6 +43,8 @@ - (id) initWithFromEmail:(NSString*)fromEmail
if (self)
{
+ completed = NO;
+
msg = [[SKPSMTPMessage alloc] init];
msg.fromEmail = fromEmail;
@@ -97,14 +100,20 @@ - (void) setValidateSSLChain:(BOOL)validateFlag
// Delegate methods
- (void)messageSent:(SKPSMTPMessage *)message
{
+ assert(msg == message);
[message release];
+ msg = nil;
+
+ completed = YES;
NSLog(@"delegate - message sent");
}
- (void)messageFailed:(SKPSMTPMessage *)message error:(NSError *)error
{
[message release];
+ assert(msg == message);
+ msg = nil;
NSLog(@"delegate - error(%d): %@", [error code], [error localizedDescription]);
}
@@ -144,4 +153,13 @@ - (int) send
return [msg send];
}
+- (int) sendSynchronously
+{
+ [msg send];
+ while (msg) {
+ [[NSRunLoop mainRunLoop] runUntilDate:[NSDate distantPast]];
+ }
+ return completed;
+}
+
@end

0 comments on commit 23da4ad

Please sign in to comment.