Results 1 to 6 of 6

Thread: winsock

  1. #1

    Thread Starter
    Fanatic Member Bombdrop's Avatar
    Join Date
    Apr 2001
    Location
    St Helens, England, UK
    Posts
    667

    winsock

    Hi i'm trying to make a simple chat application for me and a mate in the office.
    my pc name = "Orleans05"
    my mates pc name "orleans11"

    now i have been trying to use the winsock control useing the UDP method as described in MSDN. I can get it ro work on my machine ( but that is pointless fro a chat app) I wounder if any one can help.
    Below is the code.

    code on my machine:
    Option Explicit

    Private Sub Form_Load()

    With udpPeerA
    .RemoteHost = "Orleans11"
    .RemotePort = 1001
    .Bind 1002
    End With

    frmPeerB.Show



    End Sub


    Private Sub txtSend_Change()
    udpPeerA.SendData txtSend.Text
    End Sub



    Private Sub udpPeerA_DataArrival(ByVal bytesTotal As Long)
    Dim strData As String
    udpPeerA.GetData strData
    txtOutput.Text = strData
    End Sub


    code I placed on my mates machine:

    Option Explicit

    Private Sub Form_Load()

    With udpPeerB
    .RemoteHost = "Orleans05"
    .RemotePort = 1002
    .Bind 1001
    End With

    End Sub

    Private Sub txtSend_Change()
    udpPeerB.SendData txtSend.Text
    End Sub



    Private Sub udpPeerB_DataArrival(ByVal bytesTotal As Long)
    Dim strData As String
    udpPeerB.GetData strData
    txtOutput.Text = strData

    End Sub

    hope some one can help.

    p.s for once one of Karl moores tut's was little help( sorry Karl , I do love your tuts)

  2. #2
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    What errors are you getting?
    And are these pc names the same as what is recognised by the network?
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  3. #3

    Thread Starter
    Fanatic Member Bombdrop's Avatar
    Join Date
    Apr 2001
    Location
    St Helens, England, UK
    Posts
    667
    Hi rjlohan , Thanks
    Yes they are the Names used:
    the error is Runn Time '40006'

  4. #4
    New Member
    Join Date
    Mar 2001
    Location
    Netherlands, Europe
    Posts
    14
    and what error description?

    martijn

  5. #5
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Yeah, give me the description if you can, I hate Error Lookup.

    The code you have should work. Check the computer names you are using, and perhaps try using their IP to test if that is where the problem lies.
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  6. #6
    Frenzied Member
    Join Date
    Aug 2000
    Location
    O!
    Posts
    1,177
    40006 is an invalid state or protocol error.

    Since your code does not indicate that you are setting the protocols to one or the other, check properties for the winsock controls and change the protocols to UDT if they are set to TCP.

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