Click to See Complete Forum and Search --> : winsock1.connect
xstopx81
Sep 13th, 2000, 03:42 PM
what is remotehost?, i mean what should i put in for remotehost when connecting to winsock1?
Dim
Sep 13th, 2000, 05:13 PM
Remotehost = the ip of the place you are trying to connect to. RemotePort = the post that you want to use.
ie.
Dim ip as String
ip = "123.123.123.123"
Dim port As String
port = "12"
Winsock1.Connect ip, port
Hope that helps,
D!m
xstopx81
Sep 13th, 2000, 05:20 PM
thanks for replying me...
i was wondering if the ip address that i have is in the right format mine's 208.46.177.133
and another one... winsock1.localip returns my ip address...
if i cant get my ip through that, why can't i just go
dim temp
temp = winsock1.localip
winsock1.connect temp
help me
Dim
Sep 13th, 2000, 07:24 PM
'if you want to go that way, then.
Dim ip As String
ip = Winsock1.LocalIP
Dim port As String
port = "21" 'make sure to specify a correct port
Winsock1.Connenct ip, port
Gl,
D!m
vearn2
Sep 13th, 2000, 09:03 PM
hi..
can you tell me how to choose the port?
ex:
port 0 : ...for what? what it's mean..
port 23:
port 80:
etc..
thanx
Dim
Sep 13th, 2000, 10:53 PM
Well when programming with winsock you usualy have a server and a client. On the server you make the program listen on a specific port and then the client connects to that port.
Winsock1.LocalPort = "123"
Winsock1.Listen
Then use the previously posted code to attempt to connect to the server.
I can't post the function of all the ports...bt the most commonly used are...
80 - site
21 - ftp
25 - mail server
23 - telnet
1080 - icq
12345 - netbus
31337 - BO
There are well over 65k of them and you would just have to setup your server to listen on one that is not currently being used.
Gl,
D!m
PS. if you want more examples on winsock...search for "winsock" on Planet Source Code (http://www.planetsourcecode.com)
ccoder
Sep 15th, 2000, 02:22 PM
For a list of port numbers and their use see:
http://www.isi.edu/in-notes/iana/assignments/port-numbers
For more info on the Winsock API see:
http://www.cyberport.com/~tangent/programming/winsock/
HTH
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.