257 questions
-3
votes
1
answer
186
views
Event-Driven vs. SocketChannel Loop: Best Approach for a simple Java Chat System? [closed]
I am developing a chat system in Java and evaluating two different approaches for handling communications:
SocketChannel with a While Loop – A commonly used method that is straightforward to ...
1
vote
1
answer
198
views
Laravel / Pusher, broadcasting/auth, Broadcast channel not working correct
I'm trying to use one Server (Backend) as source to transmit data to private channels.
Trying as Client another place/machine (mob app / , server/client), connect to private channel to be able to read ...
0
votes
1
answer
241
views
I want my Jpos Server handle Json format message through TCP/IP or Postman, i don't know how to proceed
The final objective is to be able to take a JSON message from any client, convert it into ISOMsg, and send it to a destination server able to answer ISO 8583 messages ( I use Jpos Server to simulate a ...
1
vote
3
answers
433
views
How to use Jpos to dynamicaly route my message using a criteria in my xml message?
1- As far as my knowledge, we can receive an ISO8583 message from one host do some processing, and forward the message to another host using server.xml, channel.xml, and mux.xml config files.
2- We ...
1
vote
0
answers
140
views
How to use Presence channel for pusher in flutter
I am using pusher_channels_flutter package to get real time notifications.
I want to use Presence Channel for Pusher in flutter, below:
await pusher.subscribe(` `
channelName: "presence-chat&...
-1
votes
1
answer
85
views
why SelectionKey.attachment() is null?
Here's the main part of server code:
Selector selector = Selector.open();
ServerSocketChannel serverSocket = ServerSocketChannel.open();
serverSocket.bind(new InetSocketAddress(InetAddress....
0
votes
0
answers
44
views
Some Java NIO selector keys perpetually in non-ready state
I am using NIO in java to listen to incoming packets from a bunch of IOT devices. My (standard) code to listen to the connections is as follows:
try {
while (!shutdown) {
...
0
votes
1
answer
66
views
What is the minimum number of written bytes of a SocketChannel when its key is writable?
Let's say we're going to write some bytes to a SocketChannel within a writable SelectionKey.
// in a single selection loop
if (selectedKey.isWritable()) {
final var channel = (SocketChannel) ...
0
votes
0
answers
38
views
Close SocketChannel ungracefully on purpose
Is it possible to close the SocketChannel without sending an end of stream message?
I want to free the socket resource from an application A but without the other side (application B) noticing it has ...
1
vote
0
answers
108
views
How to properly handshake in java using nonblocking socketchannels from the JSSE library?
I'm struggling to understand how to establish secure communication (the handshake) between a client and server using the JSSE library.
I've read the documentation and have understood the first few ...
0
votes
0
answers
66
views
Maintaining a list of SocketChannels that are unique
I am using Java NIO and selectors to get instances of SocketChannels. I need to attach each instance of a SocketChannel that I get from the selector to an encryption key that is unique to each ...
-1
votes
2
answers
346
views
Selector.select() is not blocking after a SelectionKey.isReadable is read
I have a Socket that connects to a ServerSocketChannel which passes off to another Selector. The client socket sends a one time message of 8 bytes, I successfully read it, but then selector which I ...
0
votes
0
answers
80
views
It's possible with a non-blocking SocketChannel to read all present buffered data while preventing further receiving from clients?
The use case is, in an only reading server, when a shutdown request is received to prevent clients to send more data but do the best effort to process possible data in buffers.
I've tried with ...
0
votes
1
answer
91
views
Java Asynchroussocketchannel.read using future problem
I am trying to create an application where my client program reads the message from echo server. I'm trying to use Future to read the message from the server that will have a larger size than my ...
0
votes
0
answers
120
views
Why does client not receive final server answer in non-blocking client-server app?
I am trying to figure out NIO in Java doing some simple client-server project.
The case is I have to concurrent clients in cached thread pool executor, who are communicating with single-threaded ...