Public Sub ConnectCallback(ByVal ar As IAsyncResult) On Error GoTo err1 Clientsocket.EndConnect(ar)
Dim dlg As
If(Me.InvokeRequired) Then // its a Cross Thread...
Me.Invoke( New NoParamsDelegate(AddressOf ConnectedUI)) ' Isn't it Enough
Else
ConnectedUI()
End If Dim bytes(4095) As Byte Clientsocket.BeginReceive(bytes, 0, bytes.Length, SocketFlags.None, _ AddressOf ReceiveCallBack, bytes) err1: End Sub
I think It should work
I dont see purpose if this dlg.Invoke()
I'm C# developer I'm sorry if i'm wrong somewhere!
Best Regards,
|