Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 13th, 2006, 10:50 PM   #1
RAzR Creations
Programmer
 
RAzR Creations's Avatar
 
Join Date: Apr 2006
Location: orange park Fl
Posts: 53
Rep Power: 3 RAzR Creations is on a distinguished road
Cool well i need some help on winsock stuff

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?
RAzR Creations is offline   Reply With Quote
Old Jun 13th, 2006, 11:23 PM   #2
Booooze
Expert Programmer
 
Booooze's Avatar
 
Join Date: Mar 2006
Location: Igloo
Posts: 710
Rep Power: 3 Booooze is on a distinguished road
Send a message via MSN to Booooze
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
Booooze is offline   Reply With Quote
Old Jun 13th, 2006, 11:28 PM   #3
RAzR Creations
Programmer
 
RAzR Creations's Avatar
 
Join Date: Apr 2006
Location: orange park Fl
Posts: 53
Rep Power: 3 RAzR Creations is on a distinguished road
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
RAzR Creations is offline   Reply With Quote
Old Jun 13th, 2006, 11:30 PM   #4
Booooze
Expert Programmer
 
Booooze's Avatar
 
Join Date: Mar 2006
Location: Igloo
Posts: 710
Rep Power: 3 Booooze is on a distinguished road
Send a message via MSN to Booooze
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.
Booooze is offline   Reply With Quote
Old Jun 13th, 2006, 11:31 PM   #5
RAzR Creations
Programmer
 
RAzR Creations's Avatar
 
Join Date: Apr 2006
Location: orange park Fl
Posts: 53
Rep Power: 3 RAzR Creations is on a distinguished road
ahh ok well lemme know if u figure it out k?
RAzR Creations is offline   Reply With Quote
Old Jun 13th, 2006, 11:37 PM   #6
Booooze
Expert Programmer
 
Booooze's Avatar
 
Join Date: Mar 2006
Location: Igloo
Posts: 710
Rep Power: 3 Booooze is on a distinguished road
Send a message via MSN to Booooze
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.
Booooze is offline   Reply With Quote
Old Jun 13th, 2006, 11:50 PM   #7
RAzR Creations
Programmer
 
RAzR Creations's Avatar
 
Join Date: Apr 2006
Location: orange park Fl
Posts: 53
Rep Power: 3 RAzR Creations is on a distinguished road
Does Anyone else have a suggestion?
RAzR Creations is offline   Reply With Quote
Old Jun 14th, 2006, 3:40 AM   #8
kruptof
Professional Programmer
 
kruptof's Avatar
 
Join Date: May 2006
Location: UK - London
Posts: 330
Rep Power: 3 kruptof is on a distinguished road
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:
When I was young it seemed that life was so wonderful,a miracle, oh it was beautiful, magical.
Now watch what you say or they'll be calling you a radical,a liberal, oh fanatical, criminal. Oh won't you sign up your name,we'd like to feel you're acceptable, respectable, oh presentable, a vegetable
kruptof is offline   Reply With Quote
Old Jun 15th, 2006, 7:58 AM   #9
RAzR Creations
Programmer
 
RAzR Creations's Avatar
 
Join Date: Apr 2006
Location: orange park Fl
Posts: 53
Rep Power: 3 RAzR Creations is on a distinguished road
well sadly yes i still need help
RAzR Creations is offline   Reply With Quote
Old Nov 9th, 2007, 9:23 PM   #10
ransomjulian
Newbie
 
Join Date: Nov 2007
Posts: 2
Rep Power: 0 ransomjulian is on a distinguished road
Re: well i need some help on winsock stuff

Try check the array index of Winsock control
ransomjulian is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:51 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC