Open
Description
<TouchableOpacity
onPress={() => {
if (client) {
client.setNoDelay(true);
const hugeData = 'h'.repeat(40 * 1024);
console.log('TcpSocketDemo: tcp send data start:' + new Date().getTime());
client.write(hugeData, 'utf8');
} else {
sendMessage('TcpSocketDemo:tcpClient is null');
}
}}
style={styles.moduleButton}>
<Text style={styles.buttonText}>setNoDelay_true</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
if (client) {
client.setNoDelay(false);
const hugeData = 'h'.repeat(40 * 1024);
console.log('TcpSocketDemo: tcp send data start:' + new Date().getTime());
client.write(hugeData, 'utf8');
} else {
sendMessage('TcpSocketDemo:tcpClient is null');
}
}}
style={styles.moduleButton}>
<Text style={styles.buttonText}>setNoDelay_false</Text>
</TouchableOpacity>
This is my code. I called setNoDelay and set true and false respectively to transfer data, but the effect is the same for both