using the following code, I get an exception thrown on every ninth byte.
Public Function SendData(Data As Byte) As Boolean Dim ret As Boolean Dim DataByteArray() = {Data} Try clientSocket.Send(DataByteArray) ret = True Catch ex As Exception ret = False End Try Return ret End Function
This happens reliably every time.
The other odd thing is when I look at the data using wireshark, the data in the packets is always as follows.
1 data byte
7 data bytes
(exception thrown byte never sent)
1 data byte
7 data bytes
(exception thrown byte never sent)
this pattern continues until there is no more data to send.
If I catch the false return from the above method and just call the method again with the same byte, it works, so it is not the contents of the byte that is the problem (it is also different with every ninth byte not being the same data anyway)
Recalling the same method after an exception fixes the problem in as much as the byte is eventually sent, but it slows down the execution dramatically as you can imagine, and is not an acceptable workaround.
Can anybody think of something I might be doing wrong?
Regards
Rohan