Sockets don't quite work, but they will almost work.
[ITFoundation.git] / ShowcaseController.m
index 00fb696..d121bb6 100755 (executable)
@@ -7,21 +7,41 @@
 //
 
 #import "ShowcaseController.h"
+#import "ITInetSocket.h"
+#import <Foundation/NSString.h>
+#import <SystemConfiguration/SystemConfiguration.h>
 
 
 @implementation ShowcaseController
 - (void)awakeFromNib
 {
-    
-    ITInetServerSocket *sock = [[ITInetServerSocket alloc] initWithDelegate:self];
-    NSLog(@"rawr?");
-    [sock setPort:4776];
-    [sock setServiceName:@"Test Rendezvous Service"];
-    [sock setServiceType:@"ittest" useForPort:NO];
-    [sock start];
+    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
+{
+}
+
+- (void) newDataAdded:(ITByteStream*)sender
+{
+
 }
 
 - (void)newClientJoined:(ITInetSocket*)client
 {
+    
 }
 @end