I wasn't sure which client I needed to close, so I did both. I'm guessing it should only be "u.Close()"?
My code flow should be:
Add commands to buffer
Send thread command
Wait for response (for 5 secs)
- or if no response, remove command from buffer
Thanks for you reply.
I've changed the receive process to
Private Sub ReceiveCallback(ByVal ar As IAsyncResult)
Dim u As UdpClient = CType((CType(ar.AsyncState, Cls_UDPState)).UDPClient, UdpClient)
Dim e As IPEndPoint = CType((CType(ar.AsyncState, Cls_UDPState)).EndPoint, IPEndPoint)...
I think COM Port name strings are a fixed length.
The best way I've got COM port names is by using My.Computer.Ports.SerialPortNames.
Add these to a list and use this to get the port you want to use.
For Each COMString As String In My.Computer.Ports.SerialPortNames...
I'm trying to write a UDP application that sends a message and waits for a response before sending another.
To do this I am using a Semaphore initialising with the total threads, up to 6, and a count of 1.
In the Semaphore thread, I have a loop that runs as long as the semaphore is not complete...
Not sure if this is the right Forum to post this.
I am developing an application to handle communication with a number of hardware devices using a Serial RS232 ComPort, but this would involve using numerous adapters.
Is there a way to create a ComPort without the need for hardware in vb.net?