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

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

p2p main{
server connection setup
for(;;) accept connections
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");

Please help :(

10-04-2007, 04: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