|
-
Sep 12th, 2010, 02:18 AM
#1
Thread Starter
Member
Winsock can only connect to localhost
Please help 
Could it be because I don't have a port open?
I'm using ports:
12345
12346
12347
12348
12349
12355
12356
Last edited by Magestickown; Sep 12th, 2010 at 02:30 AM.
-
Sep 12th, 2010, 02:30 AM
#2
Re: Winsock can only connect to localhost
Please post the code you are using. Thank you!
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Sep 12th, 2010, 02:31 AM
#3
Thread Starter
Member
Re: Winsock can only connect to localhost
 Originally Posted by Nightwalker83
Please post the code you are using. Thank you!
Code:
Winsock1.RemoteHost = txtIP
Winsock1.RemotePort = txtPort
Winsock2.RemoteHost = txtIP
Winsock2.RemotePort = 12346
Winsock3.RemoteHost = txtIP
Winsock3.RemotePort = 12349
Winsock4.RemoteHost = txtIP
Winsock4.RemotePort = 12348
Winsock5.RemoteHost = txtIP
Winsock5.RemotePort = 12355
Winsock6.RemoteHost = txtIP
Winsock6.RemotePort = 12356
Winsock1.Connect
Winsock2.Connect
Winsock3.Connect
Winsock4.Connect
Winsock5.Connect
Winsock6.Connect
-
Sep 12th, 2010, 02:38 AM
#4
Re: Winsock can only connect to localhost
You can find heaps of examples in the vb6 and earlier codebank on how to let winsock communicated between two or more computers.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Sep 12th, 2010, 02:39 AM
#5
Thread Starter
Member
Re: Winsock can only connect to localhost
 Originally Posted by Nightwalker83
You can find heaps of examples in the vb6 and earlier codebank on how to let winsock communicated between two or more computers.
it's all connected to one computer on said ports.
-
Sep 12th, 2010, 02:42 AM
#6
Re: Winsock can only connect to localhost
You can find heaps of examples in the codebank (link below):
http://www.vbforums.com/forumdisplay.php?f=43
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Sep 12th, 2010, 02:47 AM
#7
Re: Winsock can only connect to localhost
What exactly are you trying to do ?
You are attempting to connect to whatever is in txtIP, so if you've entered "localhost" or the IP Address of the Local Machine in txtIP then Winsock will attempt to connect to whatever is Listening on the Local Machine on the Ports you specified.
-
Sep 12th, 2010, 02:53 AM
#8
Thread Starter
Member
Re: Winsock can only connect to localhost
 Originally Posted by Doogle
What exactly are you trying to do ?
You are attempting to connect to whatever is in txtIP, so if you've entered "localhost" or the IP Address of the Local Machine in txtIP then Winsock will attempt to connect to whatever is Listening on the Local Machine on the Ports you specified.
Sorry, to clarify; by "localhost" I mean 127.0.0.1.
Yes.
So if I enter..... Uh, 24.68.349.120 and there was a listening socket with said ports, it would connect, but it only will connect if it's listening on 127.0.0.1 and attempting to connect on 127.0.0.1. any other IP will not work
-
Sep 12th, 2010, 02:58 AM
#9
Re: Winsock can only connect to localhost
Yes, that's how TCP/IP works. You can't connect to a TCP/IP connection unless something is listening on that combination of IP Address and TCP Port Number.
As I said before what exactly are you trying to do ?
If, for instance, you're trying to connect to your external IP address from another computer you'll probably have to enable Port Forwarding for the Port(s) in question on your Router. Normally, in most Routers the not 'well known' ports are not forwarded by default.
EDIT: If you're trying to connect to Computer A from Computer B on your local network then Computer A will listen on a Port and Computer B will connect to Computer A's IP address and the same Port number.
-
Sep 12th, 2010, 03:00 AM
#10
Thread Starter
Member
Re: Winsock can only connect to localhost
 Originally Posted by Doogle
Yes, that's how TCP/IP works. You can't connect to a TCP/IP connection unless something is listening on that combination of IP Address and TCP Port Number.
As I said before what exactly are you trying to do ?
If, for instance, you're trying to connect to your external IP address from another computer you'll probably have to enable Port Forwarding for the Port(s) in question on your Router. Normally, in most Routers the not 'well known' ports are not forwarded by default.
Ohhh.. So I need to have made sure user server has port forwarded, or it won't connect?
'Cause I just did as test with my friend (server). And it did not work. I cannot access my router so I cannot be the server (It's an access point).
-
Sep 12th, 2010, 03:02 AM
#11
Re: Winsock can only connect to localhost
-
Sep 12th, 2010, 03:03 AM
#12
Thread Starter
Member
Re: Winsock can only connect to localhost
 Originally Posted by Doogle
Yes that's right.
Alright I'll get him to do that. Thank you!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|