...

View Full Version : peer-to-peer connection wont work



klam
09-29-2007, 05:45 PM
Im trying to create a p2p connection and the p2p connection logic goes like this:


p2p main{
server connection setup
fork_1()
child:
for(;;) accept connections
fork_2()
child: do p2p connection when a connection is received from a peer
parent: keep listening for new connections
parent: do client/server connection (is kept open all the time)
}

could someone tell me where the logic fails? im connected to the server from the client alrite but when i try from another computer to connect to the p2p (say client1) from another p2p (say client 2) (second fork should handle that) the second client says it cannot connect to client 1..


if (connect(sd, (struct sockaddr *)&peer, sizeof(peer)) == -1) {
fprintf(stderr, "Can't connect.\n");
exit(1);
}

Please help :(

Dunna
10-04-2007, 05:36 AM
Post more code, can't see the problem from 1 statement and pseudo code.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum