|
-
Aug 14th, 2003, 03:19 PM
#1
Thread Starter
Fanatic Member
Resolved: Winsock with 2 ip's (I doubt anyone will know this)
Allright I have a computer with 2 ip adreses. One is the internet ip and 1 network card for a network ip. Now when I open a port with winsock on this pc it is always the network port. But I need to open the Internet Ip port. Can I do this??
And is there a difference. For example has got each of there ip adressen there own port let same 12000 or something?
Last edited by jacsoft; Aug 15th, 2003 at 04:46 PM.
Don't Hate Me Cause You Ain't Me
-
Aug 14th, 2003, 03:23 PM
#2
Hyperactive Member
if you open port 5000 for example... it will be able to accept connections from your LAN or INTERNET. so they share the same port.
-
Aug 14th, 2003, 08:07 PM
#3
Frenzied Member
I'm not sure if the issue is the same I'm facing, but I'll give it a go.
I'm writing an app that will reside on a machine that (I guess), needs to have two NICs. One is for the local network, the other is for a different network. I don't know much about this, but I guess this machine has two IP addresses.
I'm thinking of using two Winsock controls. One, tcpServer, accepts multple connections from the local network. The second, tcpClient, sends/receives messages to the outside network. Then, when a response is received, it forwards that response to the appropriate client.
Reading the help, it says if you use UDP you can specify the network adapter in the Bind() method. But I need TCP.
Wondering how to go about this. Is it possible to receive data over one NIC and send data on another?
A network guy told me (and I may not remember this correctly) that he could tell the router to use one NIC if the IP address began with x, then use the other NIC if it began with y. In this case I wouldn't have to worry about anything.
Does anyone have any insight into this? Any info if greatly appreciated.
Mike
-
Aug 14th, 2003, 09:48 PM
#4
The picture isn't missing
your network ip's should be something like 192.168.1.x. you could check using ipconfig in dos in NT, or winipconfig in 98/me.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Aug 15th, 2003, 03:13 AM
#5
Frenzied Member
There are 3 ranges reserved for private Use.
10.0.0.0 Through 10.255.255.255
172.16.0.0 Through 172.16.255.255
192.168.0.0 Through 192.168.255.255
It could be any of them depending on how you're set up.
-
Aug 15th, 2003, 05:30 AM
#6
Thread Starter
Fanatic Member
That's not what I'm asking .
I now all about ip adresses etc. But I want to know how to open a port on a specifiek ip adress. Cause I've tried on my computer with 2 ip adresses when I opened a port to connect. But I could only connect through the network and not through the internet.
So does anyone knows how this is possible?
Don't Hate Me Cause You Ain't Me
-
Aug 15th, 2003, 05:44 AM
#7
Addicted Member
I have no network or anything set up. I do know that a computer trying to connect to you through the internet may not be getting to you because of a firewall, proxy server e.t.c
Windows XP comes with a built in firewall. I don't know much about this either not having windows XP but there may be some stuff on the help???
Scott
**********
Visit my web page at www.hyphenex.ugtech.net
-
Aug 15th, 2003, 05:55 AM
#8
Thread Starter
Fanatic Member
I got Windows 98! And now firewall. The only thing that's running on it is Norton Antivirus 2003, Sygate Home Network and ClearMem
Don't Hate Me Cause You Ain't Me
-
Aug 15th, 2003, 06:17 AM
#9
Addicted Member
If your on the internet now then send me an e-mail at [email protected] or you can add me to your msn list. I will see if I can ping you and we can sort out this thing through the net. Just to eliminate a few problems
Scott
**********
Visit my web page at www.hyphenex.ugtech.net
-
Aug 15th, 2003, 06:30 AM
#10
Thread Starter
Fanatic Member
Well king scott I'm on ther internet right now but I am not at the computer with the problem. So I will add you when I get home.
But the problem is that the computer is sharing the internet wich might be the problem. I know that pinging works:xxx.xxx.xxx.xxx if you want to try.
Do I need to have Vb installed on that server when you want to try cause I have nog and it is only a:
Amd k6-2 300
32 mb ram
2 mb video
2,1 gb hd
and a laptop
Last edited by jacsoft; Aug 15th, 2003 at 08:24 AM.
Don't Hate Me Cause You Ain't Me
-
Aug 15th, 2003, 06:36 AM
#11
Addicted Member
not that then %0 data loss.
Well you should have really told that to me in person then posting it on the internet for the world to see. The only way I could think to do it is use the Bind. Never used it before in my life before so you should try to search up some things in Google.
I think you could use this because it comes up with bind(post as string, IP as string )
Scott
**********
Visit my web page at www.hyphenex.ugtech.net
-
Aug 15th, 2003, 06:39 AM
#12
KING BODWAD XXI
-
Aug 15th, 2003, 06:40 AM
#13
KING BODWAD XXI
You trying to share the internet????
-
Aug 15th, 2003, 08:35 AM
#14
Thread Starter
Fanatic Member
Originally posted by king_scott_2
Well you should have really told that to me in person then posting it on the internet for the world to see. [/I] )
Well I didn't mind, cause who would attack me. This forum is not being used by hackers (as far as I know) and it was only on let's say 2 hours and btw there is nothing to find on my pc and I have an image of my computer so if someone wants to do harm within 30 minutes I got it al back. And btw if you try random ip numbers it will also be possible to come on my computer so..
Yep I'm sharing the internet .
I got a hub at home and my computer has got ADSL and a network card and the only thing that computer does is making sure the other 6(!) computers at my place can use the internet.
Very usefull and cheaper then a router cause I already had that computer lying doing nothing.
But the problem is when I open on a random winsock a port I can't connect by internet it just doesn't see the internet ip.
Kinda like what Mike said with to NIC's then you couldn't use a server cause all ports (65500) can be easily get full cause if you use P2p chat programs etc you get for each user a connection and when you got 6 computers on and 2 network cards you get double ports cause on 1 port it must connect to internet and on an other to the network. So you have only got 32000 ports or something and that divided by 6 is 6000 for each computer so I think that's not much especially when you know what I'm doing . I'm am opening ports like crazy!
Don't Hate Me Cause You Ain't Me
-
Aug 15th, 2003, 08:42 AM
#15
Addicted Member
well we answered your question. If you listen on a port it will be listening on both the internet and the LAN.
Scott
**********
Visit my web page at www.hyphenex.ugtech.net
-
Aug 15th, 2003, 08:50 AM
#16
KING BODWAD XXI
-
Aug 15th, 2003, 08:52 AM
#17
Addicted Member
check out www.pscode.com for whats called a 'proxy server'
Scott
**********
Visit my web page at www.hyphenex.ugtech.net
-
Aug 15th, 2003, 09:35 AM
#18
Frenzied Member
ok, but how can one open two Winsock controls to send, not listen, using two NICs?
That is, I need to send info over 192.x.x.x and 170.x.x.x
-
Aug 15th, 2003, 09:44 AM
#19
Addicted Member
you need to have a connection established before you can send on another control.
For example - You could have one winsock control listening on port 1 for your LAN and one on port 2 for the internet. After the connection has been established you can start sending on both. Sorry if I'm starting to be useless but it's 2:00 and i'm going to bed
Scott
**********
Visit my web page at www.hyphenex.ugtech.net
-
Aug 15th, 2003, 09:55 AM
#20
Frenzied Member
Not sure if I'm getting this. This is what I need to do:
A server application listens for client messages on the local network (say 192.x.x.x). When data is received, it must send on another network (170.x.x.x). When the 170.x.x.x address returns a response, the app must forward that to the 192.x.x.x address.
So, the app waits for a connection on the 192 address, but must initiate on the 170 address.
-
Aug 15th, 2003, 11:06 AM
#21
Thread Starter
Fanatic Member
Originally posted by king_scott_2
you need to have a connection established before you can send on another control.
For example - You could have one winsock control listening on port 1 for your LAN and one on port 2 for the internet. After the connection has been established you can start sending on both. Sorry if I'm starting to be useless but it's 2:00 and i'm going to bed
Well thanks for now I will make a small app wich will be able to connect en open ports to test it completely. I just got home (it's not as last as at yours, time difference. But I will test it with some other friends cause you are sleeping right now.
Thanx for the information. And I will let it know what comes out. I know that a proxy server can be used etc, but that's exactly what I don't want and I know I can connect from that computer to another computer (with an internet ip) but I need an other person to connect to me because i have got an internet ip it should be possible.
I'll let you know.
Don't Hate Me Cause You Ain't Me
-
Aug 15th, 2003, 01:18 PM
#22
Hyperactive Member
on the computer that your having problem accepting internet connections on..... goto www.whatismyip.com .... and make sure you're attempting to connect to the correct ip.
also, inet sharing could screw things up for you...... since it may not know which computer to route the connection to...
you really should use a router. (they're only $40-$60) ... and in ur router config... u can specify exactly what ports to forward to which ips...
-
Aug 15th, 2003, 01:19 PM
#23
Hyperactive Member
someone mentioned "bind" ... ya, that's what you'd wanna use..... but you can't use that in conjuction with the winsock control. ud have to use winsock apis isntead.
the winsock control uses bind() behind the scenes..... but u dont have any control over the ip it binds to. (but it shouldnt matter anyways)
-
Aug 15th, 2003, 04:46 PM
#24
Thread Starter
Fanatic Member
This is so stupid!
I got it working.
The problem was when I use a server and I am with an other computer behind that server then I can't connect to that server on his internet ip!
Kinda stupid but after hard searching I found out that some else could connect.
Sorry for all the inconvenience here and thanx to you all for helping me.
Jarry
Don't Hate Me Cause You Ain't Me
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
|