Discussion in "General help Guidance and Discussion" started by    abbas1707    Dec 3, 2007.
Mon Dec 03 2007, 03:49 am
#1
hi,
i have made a small chat program using in vb. im connected to LAN.
im taking my pc as both server and client.
when i connect client to server( with ip="192.168.0.27" ,which is my ip at LAN) then every thing works fine.but when i give client my internet ip ( which i get from ip-adress.com) then it does not establish a connection.
im using winsock.
is it not possible??? is winsock only limited to LAN addresses???? is it possible to
send data from my pc to to another pc in some different city..using winsock in vb????
Mon Dec 03 2007, 04:32 pm
#2
winsock will work.. As you are on LAN so i think you need to port forward the port used during chat connection in your router.. to connect to other PC.
Mon Dec 03 2007, 08:57 pm
#3
i cant understand what u said


[ Edited Mon Dec 03 2007, 09:02 pm ]
Tue Dec 04 2007, 12:47 am
#4
login to your router.. generally from http://192.168.1.1 or http://192.168.0.1
then go to option advance settings -> virtual server or port forward

the thing is when you access a PC from outside the network by giving a network ip, then first the request comes to the router so if you have forwarded the port on your router that request will go to the PC for which that port is forwarded.

e.g. if i want my PC with address 192.168.0.124 to run a webserver then i need to port forward port 80 on my router to my local address. so that when request for connection at port 80 comes to my router it will get forwarded to the local PC in the network with address 192.168.0.124

just try to login to your router you will understand. or search in google if you need little more info
Tue Dec 11 2007, 12:10 am
#5
im disappointed :mad
:mad
lot of confusions .......
i am going to explain all which i want to happen :-s
let us consider
i have a pc(give some name say "A") connected to LAN( default gate way 192.168.0.1 and address 192.168.0.27).
when i open "whatismyipis.com" it shows me "Your ip is:202.108.155.2". now this ip is actually the ip
of server to which im connected.and it is same for all pc's connected
to this server.


now consider
there is another pc(give name say "B") connected to some LAN( default gate way 192.168.0.1 and address 192.168.0.124) in some different city.
when some one open "whatismyipis.com" at this it shows "Your ip is:202.178.165.2".

also consider one more pc(give name say "c") having modem.when "c" runs dial up connection..it get connected to internet
when "c" opens its network connections, there are 2 ip. Server ip(202.154.121.2), client ip(202.154.120.44)

and last consider "D" also having modem as "C"


>>>>>now keeping in mind "A","B","c","D"


***1st confusion***

when "A" opens its browser , type some url say "www.8051projects.net" and click on GO then what will happen???

As i think

1.first request goes to defaullt gate way at port 80.
2.default gateway listens request at port 80
3.then default gateway establishes tcp connection with "www.8051projects.net"(if no DNS involved).
4.default gateway sends Get page request to "www.8051projects.net", receieves page and directs it to "A".

is it tottaly wrong???? what corrections needed????

***2nd confusion***

let "c" knows the ip of "A" (which inturn is ip of A's server), and wants to connect to "A" at port 6789.. how can it happen????

what port should be forwareded to "A" by its router so dat "c" and "A" can communicate?????



***3rd confusion***

if "c" knows the ip of "D"..and if "C" want to connect to "D" at port 6789..>>then Do they just have to open their ports
and they can start communicating ???(i.e no port forwarding involve here) or what else????




>>>> these are some confusions im facing.......and i need help badly at this time.........
plz give some guidance...
hope to get some help from u people...plz help, i will be very thankful.......




[ Edited Tue Dec 11 2007, 12:14 am ]
Tue Dec 11 2007, 01:26 pm
#6
no reply
Tue Dec 11 2007, 11:42 pm
#7
First of all sorry for late reply.. i am outside my home town so hard to access PC.. anyways... here is what i concluded about your confusions..

***1st confusion***

1.first request goes to defaullt gate way at port 80.
2.default gateway listens request at port 80
3.then default gateway establishes tcp connection with "www.8051projects.net"(if no DNS involved).
4.default gateway sends Get page request to "www.8051projects.net", receieves page and directs it to "A".

abbas1707


I don't know how router keep track of this thing.. but i think..
when local PC send a get request then a port is opened by the application on router.. and then router opens send the get request to www.8051projects.net server and the reply is sent back to the local PC via same port...


***2nd confusion***

let "c" knows the ip of "A" (which inturn is ip of A's server), and wants to connect to "A" at port 6789.. how can it happen????

what port should be forwareded to "A" by its router so dat "c" and "A" can communicate????

abbas1707



For second confusion, A is behind a router so, first A need to do a port forward on its router to its local port. so that when request on router to open a connection at port 6789 then it will be directly forwarded to A which is on local network on that router.

***3rd confusion***

if "c" knows the ip of "D"..and if "C" want to connect to "D" at port 6789..>>then Do they just have to open their ports
and they can start communicating ???(i.e no port forwarding involve here) or what else????

abbas1707



no port forwarding needed here.. only when you are behind a router or say in a local network then you need port forwarding.
 abbas1707 like this.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm
Bernardwarge
Tue Mar 26 2024, 11:15 am