yes after tcpwrite you can disconnect, that is no problem since tcpwrite will write all data or reports an error.
for the server : you could read data that is still in the buffer, it would have been better that at the close status, the buffer is checked and read if required. that is a good point.
I do not know if this works for all wiznet chips. The sample was more or less converted from the wiznet 3100A code, i did not thought about this.
i would not advise to read whatever is in the buffer unless you first have checked that there was a valid connection.
↧