Bah, Networking Woes!
Bah, Networking Woes!
- Subject: Bah, Networking Woes!
- From: Graham Wihlidal <email@hidden>
- Date: Tue, 10 Jul 2001 04:04:19 -0600
I can't seem to get this code working, anyone know what I am doing
wrong? I have the server running on that port, yet it never receives
any connection requests.
TIA,
Graham
void StartupSocket(void)
{
CFSocketRef s = CFSocketCreate(NULL, PF_INET, SOCK_STREAM,
IPPROTO_TCP, kCFSocketDataCallBack, SocketDataAvailable, NULL);
CFRunLoopSourceRef source;
CFDataRef addr;
struct sockaddr_in sin;
char addy[] = "gamescouter.com";
memset(&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_port = htons(4444);
addr = CFDataCreate(NULL,addy, sizeof(addy));
CFSocketConnectToAddress(s, addr, 0);
source = CFSocketCreateRunLoopSource(NULL, s, 0);
CFRunLoopAddSource(CFRunLoopGetCurrent(), source,
kCFRunLoopCommonModes);
}
SocketDataAvailable(CFSocketRef s, CFSocketCallBackType type, CFDataRef
address, const void *data, void *info)
{
printf("Got data!\n");
}