Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Socket error

Socket error

Scheduled Pinned Locked Moved Visual Basic
helpcsharp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jamal Abdul Nasir
    wrote on last edited by
    #1

    - i am using sockets ... - whenever i try to send text i get the following error...

    System.InvalidOperationException: The operation is not allowed on non-connected sockets.
    at InTheHand.Net.Sockets.BluetoothClient.GetStream()

    - the code is the following...

    Dim stream As System.IO.Stream = Nothing
    Try
    stream = client.GetStream()
    stream.Write(Buffer, 0, BufferLen)
    Catch e As Exception
    MsgBox("Error sending" & e.ToString)
    Finally
    If (Not stream Is Nothing) Then
    stream.Close()
    End If
    End Try

    - please help me out here... thanks...

    J A Nasir K

    D 1 Reply Last reply
    0
    • J Jamal Abdul Nasir

      - i am using sockets ... - whenever i try to send text i get the following error...

      System.InvalidOperationException: The operation is not allowed on non-connected sockets.
      at InTheHand.Net.Sockets.BluetoothClient.GetStream()

      - the code is the following...

      Dim stream As System.IO.Stream = Nothing
      Try
      stream = client.GetStream()
      stream.Write(Buffer, 0, BufferLen)
      Catch e As Exception
      MsgBox("Error sending" & e.ToString)
      Finally
      If (Not stream Is Nothing) Then
      stream.Close()
      End If
      End Try

      - please help me out here... thanks...

      J A Nasir K

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Because you don't have a connection opened yet?? Since you haven't provided any of the connection code, it's impossible to say what the problem is.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008
      But no longer in 2009...

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups