PDA

View Full Version : Dedicated IP: Problem to connect!



tecozc
05-23-2009, 11:38 AM
Hi,

I'm trying to connect with the server (a programm write in C), but, it does not connect!

I have the 'Dedicated IP' service.

Somebody can help me?

I'm posting the server code:


static int initializeSocket(void) /*Server*/
{
if ( (srvSock = socket(AF_INET, SOCK_STREAM, 0)) == -1 )
return -1;

memset(&srvAddr, 0, sizeof(struct sockaddr_in));
srvAddr.sin_family = AF_INET;
srvAddr.sin_port = htons(7000);
srvAddr.sin_addr.s_addr = INADDR_ANY;

bind(srvSock, (struct sockaddr *)&srvAddr, sizeof(srvAddr));
listen(srvSock, 100);
return 0;
}

clientSock = accept(srvSock, (struct sockaddr *)&cliAddr, &cliAddr_len);

----------------------------------------
static int initializeSocket(void) /*Client*/
{
if ( (cliSock = socket(AF_INET, SOCK_STREAM, 0)) == -1 )
return -1;

memset(&srvAddr, 0, sizeof(struct sockaddr_in));
srvAddr.sin_family = AF_INET;
srvAddr.sin_port = htons(7000);
srvAddr.sin_addr.s_addr = inet_addr("my_dedicated_ip");

return 0;
}

connect(cliSock, (struct sockaddr *)&srvAddr, sizeof(srvAddr);


Thanks!

dkinzer
05-24-2009, 04:04 PM
I'm trying to connect with the server (a programm write in C), but, it does not connect!The answer depends on where the client and server code are running. One possibility is that the client code is running on your BlueHost and the server code is running somewhere else, outside of the BlueHost firewall perimeter. In that case, if (as is likely) the BlueHost firewall blocks outbound connections on port 7000 (which you used in the code you posted) the connection request will time out.

If the client and server roles are reversed, again the BlueHost firewall may be blocking inbound requests on port 7000.

If both the client and server code are running on your BlueHost server, there shouldn't be a problem at all.

The last possibility is that neither the client nor the server code are running on a BlueHost server. In that case, you shouldn't have posted the question to this forum.

tecozc
05-24-2009, 05:43 PM
Hi,

The server code is running on BlueHost, the client is running outside of bluehost...


I already changed the server's ports to 3000, 4000, 6550, and not yet is connecting... I think that firewall are blocking the ports...

If the firewall are blocking, how to unlock it?

PS: I already tested with ventrilo's server and also does not connect.


thanks!

felgall
05-24-2009, 07:58 PM
You could try asking support to unblock that port in the firewapp for your IP address.

tecozc
05-25-2009, 11:09 AM
Humm… Ok, then, how to do it request to the support? For email? which is the email?

Forgive me to ask it but, I am only a developer… Another person who made the register!

Early Out
05-25-2009, 12:17 PM
You would use Live Chat (big blue button on the main bluehost.com page). But to make any such request to support, you must be the owner of the account (obviously).