Sockets don't quite work, but they will almost work.
[ITFoundation.git] / ShowcaseController.m
index 2efe0a4..d121bb6 100755 (executable)
@@ -7,21 +7,41 @@
 //
 
 #import "ShowcaseController.h"
 //
 
 #import "ShowcaseController.h"
+#import "ITInetSocket.h"
+#import <Foundation/NSString.h>
+#import <SystemConfiguration/SystemConfiguration.h>
 
 
 @implementation ShowcaseController
 
 
 @implementation ShowcaseController
-- (void)applicationDidFinishLaunching:(NSNotification *)note
+- (void)awakeFromNib
+{
+    server = [[ITInetServerSocket alloc] initWithDelegate:self];
+    [server setPort:1338];
+    [server setServiceType:@"ittest" useForPort:NO];
+    [server setServiceName:[(NSString*)SCDynamicStoreCopyComputerName(NULL,NULL) autorelease]];
+    [server start];
+    [ITInetSocket startAutoconnectingToService:@"ittest" delegate:self];
+}
+
+- (void) finishedConnecting:(ITInetSocket *)sender {
+    [sender disconnect];
+}
+
+- (void) errorOccured:(ITInetSocketError)err during:(ITInetSocketState)state onSocket:(in ITInetSocket*)sender
+{
+}
+
+- (void) dataReceived:(ITInetSocket *)sender
 {
 {
-    
-    ITInetServerSocket *sock = [[ITInetServerSocket alloc] initWithDelegate:self];
-    NSLog(@"rawr?");
-    [sock setPort:4776];
-    [sock setServiceName:@"Test Rendezvous Service"];
-    [sock setServiceType:@"ittest" useForPort:NO];
-    [sock start];
+}
+
+- (void) newDataAdded:(ITByteStream*)sender
+{
+
 }
 
 - (void)newClientJoined:(ITInetSocket*)client
 {
 }
 
 - (void)newClientJoined:(ITInetSocket*)client
 {
+    
 }
 @end
 }
 @end