|
-
Jul 25th, 2001, 09:52 PM
#1
Thread Starter
Frenzied Member
Chat program
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.
-
Jul 25th, 2001, 10:10 PM
#2
Hyperactive Member
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
also, does anyone know the port for a network? i want to connect to make a chat program.
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.
-
Jul 25th, 2001, 11:15 PM
#3
Thread Starter
Frenzied Member
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?
-
Jul 26th, 2001, 12:18 AM
#4
Fanatic Member
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
-
Jul 26th, 2001, 05:29 AM
#5
Retired VBF Adm1nistrator
Code:
Dim myInputString As String
myInputString = Input("Please enter the remote computer name")
myInputString = Replace(myInputString, "\", "")
Winsock1.RemoteHost = myInputString
Winsock1.Connect
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jul 26th, 2001, 09:30 AM
#6
Lively Member
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?
-
Jul 26th, 2001, 10:18 AM
#7
Retired VBF Adm1nistrator
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jul 26th, 2001, 04:49 PM
#8
Thread Starter
Frenzied Member
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?
-
Jul 26th, 2001, 04:52 PM
#9
Hyperactive Member
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.
-
Jul 26th, 2001, 04:54 PM
#10
Thread Starter
Frenzied Member
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.
-
Jul 26th, 2001, 05:08 PM
#11
PowerPoster
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.
-
Jul 26th, 2001, 05:19 PM
#12
Thread Starter
Frenzied Member
is that it? i thought i had to change something in the code to make it not access a internet connection.
-
Jul 26th, 2001, 05:20 PM
#13
PowerPoster
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.
-
Jul 26th, 2001, 05:33 PM
#14
Fanatic Member
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.
-
Jul 26th, 2001, 05:36 PM
#15
Thread Starter
Frenzied Member
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?
-
Jul 26th, 2001, 05:51 PM
#16
Fanatic Member
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
-
Jul 26th, 2001, 09:04 PM
#17
Thread Starter
Frenzied Member
where would i find the IPs? If it is winipcfg, where would it be in winipcfg?
-
Jul 27th, 2001, 01:38 AM
#18
PowerPoster
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.
-
Jul 27th, 2001, 01:40 AM
#19
PowerPoster
Here is a screenshot of winipcfg with the ip address circled.
-
Jul 27th, 2001, 09:40 AM
#20
Thread Starter
Frenzied Member
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.
-
Jul 27th, 2001, 09:42 AM
#21
Thread Starter
Frenzied Member
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?
-
Jul 27th, 2001, 09:57 AM
#22
Retired VBF Adm1nistrator
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
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
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
|