If the client and the server agree on protocol version 4 after negotiation, the client starts communicating using that protocol. First, the client selects the method and requests it from the server. Then, the server accepts the request and continues the communication.
Note that the method codes in Version 4 are identical to the method codes in Version 3
| Method code | Method name |
|---|---|
| 1 | Get Text |
| 2 | Send Text |
| 3 | Get Files |
| 4 | Send Files |
| 5 | Get Image/Screenshot |
| 6 | Get Copied Image Only |
| 7 | Get Screenshot Only |
| 124 | Get Any |
| 125 | Info |
Method status codes in protocol version 4 are identical to method status codes of version 1.
Most of the supported methods are similar to those of Version
3, except for the acknowledgement sent or received at the end and the
changes in the Info method.
The encoding of lengths, text, file names, file contents, and images and the maximum allowed text lengths,
file name lengths, file sizes, and image sizes are identical to those of previous versions.
This method is similar to the Get Text method of previous versions, with the difference being that the client sends acknowledgement information to the server after successfully receiving the text (i.e., immediately before terminating the connection).
This method is similar to the Send Text method of previous versions, with the difference being that the server sends acknowledgement information to the client after successfully receiving the text (i.e., immediately before terminating the connection).
This method is similar to the Get Files method of Version 3, with the difference being that the client sends acknowledgement information to the server after successfully receiving all files (i.e., immediately before terminating the connection).
This method is similar to the Send Files method of Version 3, with the difference being that the server sends acknowledgement information to the client after successfully receiving all files (i.e., immediately before terminating the connection).
This method is similar to the Get Image method of previous versions, with the difference being that the client sends acknowledgement information to the server after successfully receiving the image (i.e., immediately before terminating the connection).
This method is similar to the Get Copied Image method of Version 3, with the difference being that the client sends acknowledgement information to the server after successfully receiving the image (i.e., immediately before terminating the connection).
This method is similar to the Get Screenshot method of Version 3, with the difference being that the client sends acknowledgement information to the server after successfully receiving the image (i.e., immediately before terminating the connection).
This method is similar to the Info method of previous versions, with the exception that this method in version 4 can send some additional name-value pairs describing the server information after the server name, and the acknowledgement information is sent before terminating the connection.
Once the client requests this method code from the server, the server acknowledges the client with the status OK. Then, the server will send the length of the remaining payload, followed by the payload containing the server information, to the client. Once the information is transmitted, the client sends the acknowledgement information to the server. Then, the communication ends, and the connection can be closed.