Does anyone know how i can use winsock to connect to a remote computer on a network and connecting to a computer with the remotehost as \\computername\? also, does anyone know the port for a network? i want to connect to make a chat program.
Printable View
Does anyone know how i can use winsock to connect to a remote computer on a network and connecting to a computer with the remotehost as \\computername\? also, does anyone know the port for a network? i want to connect to make a chat program.
Quote:
Does anyone know how i can use winsock to connect to a remote computer on a network?
Code:Form_Load()
'on server side
Winsock1.LocalPort = 1000
Winsock1.Listen
End Sub
Code:cmdConnect_Click()
'on client side
Winsock1.RemotePort = 1000
Winsock1.RemoteIP = 123.123.123.123
Winsock1.Connect
End Sub
There is no select port for a network. You can use any you'd like... this will work because you're making a client/server type chat program.Quote:
also, does anyone know the port for a network? i want to connect to make a chat program.
I dont know if that will work the way i want it to...see..i have a input box that asks for the computer hostname (e.g. \\hostname\). I was wondering if i could connect to the remote computer using something like \\hostname\. Or do i have to stick with the IP?
the winsock control supports bot methods
VB Code:
Winsock1.RemoteHost 'Remote Host unc Name Winsock1.RemoteHostIP 'Remote Host IP Winsock1.RemotePort 'Remote Port
You only need to supply either the IP or the name
Code:Dim myInputString As String
myInputString = Input("Please enter the remote computer name")
myInputString = Replace(myInputString, "\", "")
Winsock1.RemoteHost = myInputString
Winsock1.Connect
Has anybody ever encountered that when server instance receives a connectionrequest RemoteHost is not actually the correct name of the client pc on the network?
Why is that?
Thats quite implausible.
I have a question...i was making the network chat i was talking about and i made it so you choose in the beginning if you are the Host or the Client. and then if you click client it will bring up the screen to type in the hostname of the host. (e.g. \\hostname\ like i said before) and when i hit connect, (i used the code up there for the client) it starts to load AOL (cause i use AOL :( ). The winsock wants me to dial into the internet when i want to use the network. How can i fix this?
Wow, AOL is gay... my first suggestion would be to lose it. Secondly, turn of AOL's random dial option. This way it will not start unless you tell it to. You could also see if your program recognizes that you have a internet connection already established.
No, you see, i dont want to use a Internet Connection. I want to use my network. Which means, i dont need a dial-up connection for my network. So, AOL should not load at all.
I know how to fix it. Go to Internet Explorer, go to Tools-> Internet Options... Click on the Connections tab and find the Dial-Up settings. Choose Never Dial A Connection. Now click ok and it shouldn't try to dial up anymore.
PS... If you are advanced enough to use a network, why the hell are you still using AOL? Why not get a real ISP? AOL is gay.
is that it? i thought i had to change something in the code to make it not access a internet connection.
No... the reason is because Windows monitors all network activity, and if you have it dial a connection when you try to make a network connection, then it will open AOL because AOL modifies Windows to point to it, instead of the default Dial-Up networking manager.
dont forget if you are using a network and you want to connect via the host name it will only work if there is a DNS server on your local network that will allow the hostnames to be resolved. The fact that it trying to dial up to the internet indicates that in your TCP/IP connections that the DNS servers are set to internet address.
ok well i dont have a server yet..so...how can i do it without using hostnames? my network ip? and i use IPX for games (duh) and NetBEUI for my network(works much faster) i also have TCP/IP on my network card..so yeah i have almost every protocol on my network. So, how would i connect?
well you have to options 1 use the IP address to connect to the remote system. 2 you could search the web for a free ware or shareware dns server product.
I think the easiest way would be to go with the IP addys. However you could add a central DB that when each chat program starts it logs the user computer name and IP address. Then when someone wants to chat they just select an online user (sound familiar) and you app can do the rest based on info from the database :)
where would i find the IPs? If it is winipcfg, where would it be in winipcfg?
If you open WinIPcfg, it should just show it. You might have to change the adapter to the network card that is interfaced with your network.
Here is a screenshot of winipcfg with the ip address circled.
http://www.vbforums.com/attachment.php?s=&postid=451451
yes i know where the IP Address is but, that is for your PPP Adapter which is what your ISP gave you. I want the network ip, which i think i have.
Also, when i type in Slow rider or \\Slow rider\ (thats the computer host name of the laptop, it's a 133Mhz, thats why i call it slow rider), it still gives me a address is not availble from local machine error. what does this mean?
You cant have a space in a hostname.
The identification for windows networking can though.
If you go into :
Control Panel > Network > TCP/IP Properties for your Ethernet Adapter> DNS > Hostname
And give it a proper hostname