I am trying to use the following code and answer the connection request with a string. However; I never could get the send to work and I assume it is because the connected property is never set to true. Somebody please tell me what I am missing
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
sckt.Blocking = True
sckt.Bind(endpoint)
sckt.Listen(10)
Dim callbk As New System.AsyncCallback(AddressOf callbak)
sckt.BeginAccept(callbk, 0)
End Sub
Private Sub callbak(ByVal ar As System.IAsyncResult)
Debug.Write("Connection Attempt")
Dim sendBytes As [Byte]() = System.Text.Encoding.ASCII.GetBytes("Connection Accepted")
If sckt.Connected = True Then Debug.Write("connected")
End Sub
End Class
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
sckt.Blocking = True
sckt.Bind(endpoint)
sckt.Listen(10)
Dim callbk As New System.AsyncCallback(AddressOf callbak)
sckt.BeginAccept(callbk, 0)
End Sub
Private Sub callbak(ByVal ar As System.IAsyncResult)
Debug.Write("Connection Attempt")
Dim sendBytes As [Byte]() = System.Text.Encoding.ASCII.GetBytes("Connection Accepted")
If sckt.Connected = True Then Debug.Write("connected")
End Sub
End Class