I am trying to write a program that can connect over the network. I have a server and a client, and I would like to send notifications from the server to the clients.
If I use my client to get infos from server, everything work well, but if I try to configure the connection to work both way, I got:
2013-01-17 10:44:04.948 Test Client[11475:405] Distributed objects message send timed out (timeout: 10480150844.948212 at time: 380130944.948432)
This is the code for my server (where server is an instance of a custom object):
NSSocketPort* send = [[NSSocketPort alloc] initWithTCPPort:6139];
// send=nil;
theConnection = [NSConnection connectionWithReceivePort:[[NSSocketPort alloc] initWithTCPPort:6138] sendPort:send];
[theConnection setRootObject:server];
and for my Client
NSSocketPort* recieve = [[NSSocketPort alloc]
initRemoteWithTCPPort:6139 host:@"127.0.0.1"];
// recieve =nil;
NSConnection *connection = [NSConnection
connectionWithReceivePort: recieve sendPort:
[[NSSocketPort alloc] initRemoteWithTCPPort:6138 host:@"127.0.0.1"]];
theProxy = [connection rootProxy];
If I uncomment the =nil lines, this works, but else I got the error. Does someone know what I am doing wrong?
Thanks in advance.
Have a good day!