Skip to content

Commit

Permalink
text updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Koifman committed Sep 10, 2023
1 parent 356330f commit 611964b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/tcp-udp/handling-tcp-connection-requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class TCPOptions {
}
```
The two fields of <span class="datatype">TCPOptions</span> represent the receive and send buffer sizes that will be assigned to the TCP connection at the service side;
* <span class="param">backlog</span> specifies the maximum number of queued connections that are in the process of being established or have already been established but not yet accepted by the service application. The app accepts estableshed connections by the <span class="method">tcpAccept</span> method, which is described below. If the queue is full, clients get the service busy exception. The value of backlog should be chosen such that it is not too small so as not to reject client requests with the service busy exception due to the randomness of requests that could actually be processed. The backlog is designed to smooth out peaks in client requests. But on the other hand, it should not be large so that client requests that cannot be processed due to a heavy load were not queued, but were rejected with the service busy exception. For most applications, 5 will be a reasonable value.
* <span class="param">backlog</span> specifies the maximum number of queued connections that are in the process of being established or have already been established but not yet accepted by the service application. The app accepts estableshed connections by the <span class="method">tcpAccept</span> method, which is described below. If the queue is full, clients get the service busy exception. The value of backlog should be chosen such that it is not too small so as not to reject client requests with the *Service Busy* exception due to the randomness of requests that could actually be processed. The backlog is designed to smooth out peaks in client requests. But on the other hand, it should not be large so that client requests that cannot be processed due to a heavy load were not queued, but were rejected with the service busy exception. For most applications, 5 will be a reasonable value.

The next method we have to consider is <span class="method">tcpAccept</span>. It provides an accept handler to the listener that was earlier bound to the virtual port. If there is an established connection queued in the backlog, the handler is called back immediately. To accept the next connection from the backlog, <span class="method">tcpAccept</span> should be called again. If the backlog is empty, the handler remains idle. You can control the consumption of the host resources by calling <span class="method">tcpAccept</span> only when the resources are released for clients. The following is the signature of the method:
```java
Expand Down

0 comments on commit 611964b

Please sign in to comment.