Posts

Showing posts with the label tcp

The sever send SYN/ACK after receive SYN from client immediately

The sever send SYN/ACK after receive SYN from client immediately I found the request from client timeout sometimes. And I use tcpdump on the server side to catch some special tcp packet as follows. It seems no packet was lost. Why the server doesn't reply to client after receiving the first SYN? enter image description here netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}' SYN_RECV 220 CLOSE_WAIT 1 ESTABLISHED 496 FIN_WAIT1 42 FIN_WAIT2 2 TIME_WAIT 72588 sysctl -a | grep tcp net.ipv4.tcp_abort_on_overflow = 0 net.ipv4.tcp_adv_win_scale = 1 net.ipv4.tcp_allowed_congestion_control = cubic reno net.ipv4.tcp_app_win = 31 net.ipv4.tcp_available_congestion_control = cubic reno net.ipv4.tcp_base_mss = 512 net.ipv4.tcp_challenge_ack_limit = 100 net.ipv4.tcp_congestion_control = cubic net.ipv4.tcp_dsack = 1 net.ipv4.tcp_early_retrans = 3 net.ipv4.tcp_ecn = 2 net.ipv4.tcp_fack = 1 net.ipv4.tcp_fastopen = 0 net.ipv4.tcp_fastopen_key = fc1980cc-2a3369bf-91223671-bb8e...

JMX endpoint sending empty response

JMX endpoint sending empty response I have a Java daemon process running that is supposed to expose a number of endpoints at port 15002 on localhost, showing a variety of metrics. However, when I try to submit a curl request to localhost:15002, I get an empty response/connection refused error. On the other hand, there is a another port 10002 (exposing a different set of metrics) which is working fine. curl If I do netstat -na | grep 10002 , I get: netstat -na | grep 10002 tcp 0 0 0.0.0.0:10002 0.0.0.0:* LISTEN Now, if I do the same with respect to port number 15002, I get no output, which makes me believe that this is a port issue. Is there anything that I need to be doing before I start my daemon? What makes you think that the activity on port 10002 is related to your daemon process in any way? – Holger Jul 2 at 7:54 ...

Reading a tcp packet on Node js server

Reading a tcp packet on Node js server I am trying to read a tcp packet on node js sent from c++ tcp client. Below is the struct sent by tcp client struct LoginPacket { uint16_t packetLength; // value:24 uint8_t cmd; // value: 96 uint8_t version; // value: 1 uint8_t checkSum; // value: 1 uint8_t type1; // value: 1 uint8_t type2; // value: 1 uint8_t random; // value: 8 uint8_t lengthOfText; // value: 7 char *textField; // value: "abcd" }; Below is my nodejs server application to read this struct. var tcpSock = require('net'); var server = tcpSock.createServer(function(socket) { socket.write('Echo serverrn'); socket.pipe(socket); //var buffer = new Buffer(4096, 'hex'); // listen for incoming data socket.on("data", function(data){ buf = new Buffer(256); len = buf.write(data.toString()); var Struct = require('struct').Struct; function getPacketHeader(buffer){ var packetHeader = new Struct() ...