I am a beginner.
I am confused by myself, so I think the question is incoherent.
In socket communication (Java), I don't know how to send ACK (it is sent).
Simply tell me the ACK behavior after establishing a connection in Java socket communication.
ACK is a ASCII code tableAccording to "0x06", I can't find a sample that explicitly sends 0x06 even if I check it on the net.
Hoshida's TCP memo According toso.connect,so.acceptandso.closeautomatically exchange SYN, ACK and FIN in the method Seems like.
However, when will the confirmation (ACK response) after sending return?
In fact, Socket class doesn't seem to have a receipt confirmation method.
Currently, I have three possibilities.
Assuming transmission and reception between client and server
- Socket method (.send ()) automatically attaches the acknowledgment (ACK) to the packet sent by the client when the server sends it
- Acknowledgment (ACK) to the packet sent by the client is explicitly attached with 0x06 on the data on the code when the server sends
- Acknowledgments (ACKs) for packets sent by clients are automatically returned periodically when the connection is in the established state.
Answer # 1
The ACK in the ASCII code table and the ACK for TCP communication are different. Not relevant
Answer # 2
writemethods (API) using sockets Rather than adding ACK flags, they are automatically added and managed by the OS TCP/IP stack. For example, when establishing a TCP connection, when the server side is waiting in the
ServerSocket # acceptmethod and the client side executes the
Socket # connectmethod, those methods are used. Applications are unaware,
SYN from client to server
Server to client ACK + SYN
ACK from client to serverThe flag is automatically sent and received like
, and the connection is established. (3-way handshake) For sending and receiving data after this connection is established, the flag assignment is the same, and even if the client program
write100 bytes of data, it is conscious about ACK ACK is sent and received within the scope of the OS under the application.
If you are interested, install a packet capture software such as WireShark, create your own Java server/client program, check the packet when each method (API) is executed, and send and receive those flags. You can see that
- c # - about socket communication using one pc
- about data transfer by socket communication
- java - questions about the output result of the simple program
- about java overrides
- java - about sql: (colon)
- [java] about equals method (reason why nullpointerexception does not occur even if null is passed/override)
- [java] about variable initialization
- about java version
- java - about screen display in struts2
- i have a question about a simple problem with [java] files
- about the argument of zipentry (java: jdk16)
- java - about the minus of the method
- java - about nullpointerexception
- java - about localhost
- java - about the two arguments of onclick
- java - about the stringutilsisempty () method
- i want to display the value obtained by socket communication in python with flask in html on the browser, but it is not displaye
- communication between the smartphone application and the java application fails
- beginners about the development of java spring tool suite
- java - about js that displays images randomly