Jump to content

c_connect() question


Recommended Posts

Hi! I'm not sure if this is the exact right place to post this so sorry in advance if I made that mistake, or if I missed this particular question being asked somewhere else.

So I have my dedicated server on a different computer, and I can easily connect through LAN via the

 c_connect() 

command.

But curiosity, and simplification of the connection procedure by a tiny amount made me want to know how to connect to this same server from any network.
However I cannot for Pete's sake find any answers as to what the address should look like.
If the name is

 "ThisIsAServer" 

, typing

 c_connect("ThisIsAServer", ??????, "*************") 

simply times out, indicating it's wrong/not as simple as that.

All I've found online is

 c_connect("your-hostname.subdomain.com", 10999, "my-awesome-server") 

, which made me wonder how the address should look like, and tried a few forms with no success. Do I need to buy a domain name or something for that to work?

Link to comment
Share on other sites

You can either put in a domain name of the server, or just the IP address. Either works. The full format is:

c_connect("<IP or Hostname>", <port>, "<password>")

And the password is optional, so you can also do

c_connect("<IP or Hostname>", <port>)

if your server doesn't have a password.

Not sure if you can even leave out the port, if you set the server to a default port, but I guess it could work.

Link to comment
Share on other sites

55 minutes ago, Daniel86268 said:

You can either put in a domain name of the server, or just the IP address. Either works. The full format is:


c_connect("<IP or Hostname>", <port>, "<password>")

And the password is optional, so you can also do


c_connect("<IP or Hostname>", <port>)

if your server doesn't have a password.

Not sure if you can even leave out the port, if you set the server to a default port, but I guess it could work.

Yeah, about the domain name, that's the only thing I don't understand.

How do I find out what's the domain name I should be typing in here? Is this a LAN only function?

c_connect("<IP or Hostname>", . . .)
Link to comment
Share on other sites

  • Developer
30 minutes ago, Elzar292929 said:

How do I find out what's the domain name I should be typing in here? Is this a LAN only function?

If you don't have a domain you can add DNS for, it won't work. Basically the answer here is "Use the IP unless you know you have a DNS entry pointing to the server in question". Sounds like you don't, so that has to be the IP of the host you want to connect to.

Link to comment
Share on other sites

On 3/29/2020 at 3:54 PM, Elzar292929 said:

Do I need to buy a domain name or something for that to work?

 

1 minute ago, nome said:

If you don't have a domain you can add DNS for, it won't work. Basically the answer here is "Use the IP unless you know you have a DNS entry pointing to the server in question". Sounds like you don't, so that has to be the IP of the host you want to connect to.

I see. Thanks for the answer!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...