Results 1 to 2 of 2

Thread: Calling all Communication Gurus

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    57

    Lots of questions!

    For pc to pc connections:
    Your looking at a winsock control.
    Start a new vb exe
    go to Project | components
    reference the winsock control
    put that bad boy on a form
    go into your forms code
    you're going to want to set a local port and set it to listen
    (Ports are like mailboxes on a server)
    so it'd be like..

    winsock.localport = 666
    winsock.listen

    now add a second winsock control
    and be like

    winsock2.connect "127.0.0.1", "666"
    winsock2.senddata "Tcp/ip rules!"

    then in the winsock_Connectionrequest

    winsock.accept requestID

    in winsock_Connect
    Label.caption = "Connected to " & winsock.remotehost

    in winsock_dataarrival

    (u got to get the data into a byte array and turn it into characters to display happily..)

    DIm baBuf(bytestotal) as byte
    Dim sBuf as string
    Winsock.GetData baBuf
    For i = 0 To bytesTotal - 1
    sBuf = sBuf & Chr(baBuf(i))
    Next
    label.caption = sBuf

    Boom. If ur laptop isn't online, when u try to mess with a winsock control, it handles bringing up a connect to the internet dialogue for the user..
    this lil example is both a server and a client, so in between the two, that should be enough to get you started.

    This is all FTP is - one application with port 21 listening for users - and a client that connects to remote hosts on port 21. There is plenty of winsock source code on the net to just plug right in - its even in the MSDN!
    I would have your cellular phones connect to the laptop on port 80 and serve out WML to eliminate the need for code on the cellular phone (oftentimes they have their own proprietary languages if they're programmable at all, like EPOC)
    A Wap Emulator (nokia and ericsson give em out) will help you debug any WML you're sending - as long as the cellphone can browse the web ur good. You can even generate dynamic WML pages within ASP - like a web application for a cellphone.

    If you want a cell phone to be able to dial into your laptop, well, don't ask me - that's DUN (Dial up networking) which I have no past experience with.

    FTP has its own protocol, so reprogramming it from the ground up could be tedious, you could if you had the time, read through an FTP RFC and do it within winsock, but there are plenty of ActiveX FTP type controls out there that will you get you up and running faster.

    Hope this helps

  2. #2
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    You can also use the inet control to help you along...it is much simpler to use, however, it has been quite unreliable in the past.

    Gl,
    D!m
    Dim

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