Results 1 to 7 of 7

Thread: winsock1.connect

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Ca
    Posts
    106
    what is remotehost?, i mean what should i put in for remotehost when connecting to winsock1?

  2. #2
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    Remotehost = the ip of the place you are trying to connect to. RemotePort = the post that you want to use.
    ie.
    Code:
    Dim ip as String
    ip = "123.123.123.123"
    Dim port As String
    port = "12"
    Winsock1.Connect ip, port
    Hope that helps,
    D!m
    Dim

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Ca
    Posts
    106
    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

    Code:
      dim temp
      temp = winsock1.localip
      winsock1.connect temp
    help me

  4. #4
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    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
    Gl,
    D!m
    Dim

  5. #5
    Junior Member
    Join Date
    Aug 2000
    Posts
    18
    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
    berehh!!

  6. #6
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    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.
    Code:
    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



    Dim

  7. #7
    Frenzied Member
    Join Date
    Aug 2000
    Location
    O!
    Posts
    1,177
    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width