react-native-tcp-socket icon indicating copy to clipboard operation
react-native-tcp-socket copied to clipboard

The effect of setting true or false on setNoDelay is the same

Open DaDa-He9 opened this issue 7 months ago • 0 comments

  <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

DaDa-He9 avatar Apr 28 '25 05:04 DaDa-He9