Results 1 to 3 of 3

Thread: Runtime Error 10035: Socket is nonblocking, and the specified operation will block

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 1999
    Location
    Franklin, WI, USA
    Posts
    8

    Post

    I am constantly getting the error...
    Runtime Error 10035: Socket is nonblocking, and the specified operation will block
    when I use the winsock control that came shipped with VB5EE, I tried reinstalling it from the CD-ROM, but it didn't help... does anybody have a solution?



    ------------------
    -Jonathan Sadowski
    [email protected]


  2. #2
    Lively Member benski's Avatar
    Join Date
    Sep 1999
    Location
    UK
    Posts
    126

    Post

    Which operation causes the error? Connect?

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 1999
    Location
    Franklin, WI, USA
    Posts
    8

    Post

    The opperation that caused the error was the following...

    Winsock1.SendData (KeyAscii)

    Here is the code for the program I am using...

    Private Sub Form_Load()
    ' To start the winsock control, you need to begin
    ' by sending data. We will use the ">" character
    ' since that is a popular character for chats.

    Text1.Text = ">"

    ' When you open the program, you do not have a
    ' connection with another person, so you need
    ' to set your IP as the host IP.

    Winsock1.RemoteHost = Winsock1.LocalIP

    ' Send the data.

    Winsock1.SendData ">"

    ' Set the localIP as Text4

    Text4.Text = Winsock1.LocalIP

    End Sub

    Private Sub Text1_KeyPress(KeyAscii As Integer)
    ' Set the box equivalent to itself.

    Text1 = Text1

    ' Send the data that is keyed into this textbox
    ' to the other user.

    Winsock1.SendData (KeyAscii)

    End Sub

    Private Sub Text2_KeyPress(KeyAscii As Integer)
    ' Set the textbox equivalent to itself.

    Text2 = Text2

    ' Get the data from the other user as he/she is typing.

    Winsock1.GetData (KeyAscii)

    End Sub

    Private Sub Text3_Change()
    ' Set the remote host equivalent to the
    ' IP address in Text3

    Winsock1.RemoteHost = Text3.Text

    End Sub

    Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    ' Make a string that will represent the data
    ' that is being sent from one computer to
    ' yours.

    Dim strData As String

    ' Then tell winsock to get that data and import it.

    Winsock1.GetData strData, vbString

    ' Changes the remote IP to where the incoming data
    ' came from.

    Text3.Text = Winsock1.RemoteHostIP
    Winsock1.RemoteHost = Winsock1.RemoteHostIP

    ' If the users press the backspace key, then it
    ' will register on both ends and send the data.

    If Asc(strData) = 8 And Len(Text2) > 0 Then
    Text2.Text = Mid(Text2, 1, (Len(Text2) - 1))
    Else
    Text2 = Text2 & strData
    End If

    ' If the user presses the enter key, then it
    ' will register on both ends and send the data.

    If Asc(strData) = 13 Then
    Text2 = Text2 & vbNewLine
    End If

    ' This will make the textbox the other person is
    ' talking through automatically move down when it
    ' gets to the bottom of the textbox.

    Text2.SelStart = Len(Text2)
    End Sub



    ------------------
    -Jonathan Sadowski
    [email protected]


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