3,034 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
2
answers
157
views
TCP Connection Refused Given multiple concurrent connection
I try to play with multiple concurrent tcp connection in Java.
Given 250 concurrent tcp connection, some of them will get connection refused.
It surprises me due to only 250 connection.
In large web ...
2
votes
0
answers
73
views
Using JDK16+ unix domain socket support to connect to clamd randomly fails for the n-th connection (n > 1) when using non-blocking IO
I try to connect to the clamd service (antivirus) on an Ubuntu Linux System. clamd on Ubuntu Linux can be contacted using a unix domain socket, which is by default registered under the path /var/run/...
0
votes
0
answers
37
views
Using NIO.2 to eventually delete a temporary file in Java [duplicate]
The legacy class File (singular) offers the deleteOnExit method to automatically delete a file later, when the JVM exits.
👉🏽 How to do the same in the modern NIO.2 classes?
The newer Files (plural) ...
0
votes
0
answers
50
views
How to get a filepath from a unix system using java where the path is {{parameters.secret-path}}/file
Currently there is a unix-based system that exposes a file in what the team is saying would be {{parameters.secret-path}}/file. I am not sure how to read that in java given the enclosing of double ...
0
votes
1
answer
76
views
Does Kafka write to the pagecache using FileChannel.write()?
I am trying to understand how exactly Kafka writes to the pagecache as stated in the documentation:
All data is immediately written to a persistent log on the filesystem
without necessarily flushing ...
0
votes
1
answer
83
views
reuse ByteBuffers across multiple ByteBufferBackedInputStreams
i have a question about using reusing ByteBuffers from java.nio multiple times to produce InputStreams. i've found a nice converter in jackson called ByteBufferBackedInputStream. my problem however is ...
1
vote
0
answers
39
views
Can any of selectedKeys is invalid?
I have the following code.
final SelectionKey clientKey;
if (client.connect(_Rfc863Constants.SERVER_ENDPOINT)) {
log.debug("connected to {}", client.getRemoteAddress());
clientKey = ...
0
votes
1
answer
173
views
How SO_KEEPALIVE works in socket programming
I'm a newbie to networks, please guide me for the following.
As per my understanding, by default in the OS Level, the client sends the keep-alived probes to the server and it checks if the connection ...
1
vote
1
answer
66
views
Type of position in RandomAccessFile is long but it is int in MappedByteBuffer
The RandomAccessFile class in Java uses type long in methods getFilePointer(), length(), seek(), and setLength().
However, if I want to manipulate this file via MappedByteBuffer, I can only specify ...
0
votes
2
answers
136
views
How to avoid platform based NoSuchFileException when using java.nio.file.Paths?
Whenever I run this code locally, the relative path for the file is working just fine but the Kubernetes pod deployment in pre-prod throws NoSuchFileException.
MOCK_DATA_BASE_PATH = "/data/mocks&...
0
votes
1
answer
193
views
How to know if spring boot app is using nio?
If we search our spring boot 2.0.3 project source code (all files), there is no mention of nio.
According to the spring docs, nio is disabled by default, so we would expect to not be using nio.
...
0
votes
1
answer
97
views
Cannot read the object while using thread pools to process
I have to design a server with 3 main thread pools in order to read the data, process them and output the results to the client. I code like this but it always notice this kind of bug:
java.io....
5
votes
0
answers
597
views
java.io VS java.nio when using Virtual Threads in Java 21
I am thoroughly learning Spring Boot and I am learning how to upload files and in my example I will be storing the path in the database and the contents in the file system outside of what is publicly ...
1
vote
0
answers
141
views
Tomcat NIO(non-blocking) Connector Threads Getting Blocked
I am using Jersey web framework with Scala language for one of their services.
This service is using NIO(non-blocking IO) connector with Tomcat to handle requests asynchronously. There are 10 ...
-3
votes
1
answer
98
views
Socket Server Multithreading Java NIO
i need help to create a multithreaded java socket server that can handle and process the request asynchronously.
What i did right now is i created java NIO Socket Server and Client, the client will ...