![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Apr 2006
Location: orange park Fl
Posts: 53
Rep Power: 3
![]() |
i am making a program that i want to connect to 2 computers over the internet using remotehostip what i did was on the form load event i did label1.caption = serversock.remotehostip but nothing shows up but i also want the program to auto detect it just like mine is 65.80.200.47 i want it to auto detect it and put it in the label caption can anyone help?
|
|
|
|
|
|
#2 |
|
Expert Programmer
|
The remotehostip will only be set when a connection is made and holding. You have to make a connection, then set the caption to the ip. This does not apply to the local address. For the local address (you), just use:
Label1.Caption = Winsock1.LocalIP |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Apr 2006
Location: orange park Fl
Posts: 53
Rep Power: 3
![]() |
ok so how would i make a connection with 2 computers in 2 different homes because when i do that it comes up with 192.168.1.2 and thats my router ip
|
|
|
|
|
|
#4 |
|
Expert Programmer
|
to tell you the truth, I haven't figured that out yet. you can try forwardsing the port on the router, but that may or may not help. I've been meaning to reasearch and experiment with this for a long time and haven't.
|
|
|
|
|
|
#5 |
|
Programmer
Join Date: Apr 2006
Location: orange park Fl
Posts: 53
Rep Power: 3
![]() |
ahh ok well lemme know if u figure it out k?
|
|
|
|
|
|
#6 |
|
Expert Programmer
|
I doubt I will, I'm probably not going to have time to take a crack at it for a long time, and if I do, I'll do it in C#, and I haven't even done networking yet. Not to bitch at you, but why don't you give it a try. Do some basic networking, use 127.0.0.1, and loop it back to your own computer. do basic networking that way, and then move it over to another computer, if that works, try and conquer the router.
|
|
|
|
|
|
#7 |
|
Programmer
Join Date: Apr 2006
Location: orange park Fl
Posts: 53
Rep Power: 3
![]() |
Does Anyone else have a suggestion?
|
|
|
|
|
|
#8 | |
|
Professional Programmer
Join Date: May 2006
Location: UK - London
Posts: 329
Rep Power: 3
![]() |
this is very simple program to accomplish in VB....don't worry if the program detects you IP as your local IP assign to you by your router hence the 192.168.1.100...because whatever you send out of this address goes to the router and the router would changes this address to your WAn address, and would also change your port to an external port.....with that out the way....now any router that gets the machine that you have just sended would rop that packet because it is unsolicited (routers don't route unsolicited packets). so to get that router to accept your packet you have to do what is called UDP/TCP Hole Punching......this is very simple and straight forward........i hope this help if you need help to do this then please post so then i can write a simple tutorial on it.
__________________
Quote:
|
|
|
|
|
|
|
#9 |
|
Programmer
Join Date: Apr 2006
Location: orange park Fl
Posts: 53
Rep Power: 3
![]() |
well sadly yes i still need help
|
|
|
|
|
|
#10 |
|
Newbie
Join Date: Nov 2007
Posts: 2
Rep Power: 0
![]() |
Re: well i need some help on winsock stuff
Try check the array index of
Winsock control |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|