what is remotehost?, i mean what should i put in for remotehost when connecting to winsock1?
Printable View
what is remotehost?, i mean what should i put in for remotehost when connecting to winsock1?
Remotehost = the ip of the place you are trying to connect to. RemotePort = the post that you want to use.
ie.
Hope that helps,Code:Dim ip as String
ip = "123.123.123.123"
Dim port As String
port = "12"
Winsock1.Connect ip, port
D!m
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
help meCode:dim temp
temp = winsock1.localip
winsock1.connect temp
Gl,Code:'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
D!m
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
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.
Then use the previously posted code to attempt to connect to the server.Code:Winsock1.LocalPort = "123"
Winsock1.Listen
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
For a list of port numbers and their use see:
http://www.isi.edu/in-notes/iana/ass...s/port-numbers
For more info on the Winsock API see:
http://www.cyberport.com/~tangent/programming/winsock/
HTH