mina

Java: How can I get the connected port from an InetAddress?

I'm trying to build a Java NIO-based socket server using Apache Mina. I really need to know the port of the remote host, not just the IP address, and it seems that Mina only exposes a SocketAddress (which can be downcast to InetAddress) object. I can get the IP address from InetAddress, but I normally use Socket.getPort() to get the po...

How to properly send data via MINA?

I'm attempting to get started with MINA, and all of the examples seem to have data written to the session, rather than making use of a method that can write the same type of data over and over. I'm trying to make use of org.apache.mina.filter.codec.demux.MessageEncoder / MessageDecoder to encode / decode messages, which will allow me to...

MINA: Is finishDecode where I send a response message?

In using Apache MINA, I'm sending a login request from the client, which is interpreted on the server via LoginRequestDecoder (implements org.apache.mina.filter.codec.demux.MessageDecoder). I now want to send a response (LoginResponse) that includes a success/failure code. Should I be sending the response from the LoginRequestDecoder's...

Apache MINA reading from IoSession

Dear Readers, I am new to Apache MINA kindly guide me how to read from IoSession. I have stored a POJO in it. public static EchoUDPServerDiscoveryObjectResponseProperties echoProperties session.write(echoProperties); ...

Pipe transfer blocks when writing object with small pipe size

Hi everyone, I'm having a bit of problem with an example I'm currently testing. For some reason, the execution blocks when writing at oos.writeObject(new SimpleObject());, despite that fact that the pipe should transfer the data across, even (I'd assume) if it had to do it in smaller operations due to a small pipe size. Anyway, the examp...

Java socketserver using Apache Mina - how to set up threading?

I am building a socketserver using Apache Mina and I am trying to make sense of configuring the thread model. I am currently reading: http://mina.apache.org/configuring-thread-model.html As I understand it; it is best to use multithreading for each IOService, something like: SocketAcceptor acceptor = new SocketAcceptor( Runtime...

MINA: Performing synchronous write requests / read responses

I'm attempting to perform a synchronous write/read in a demux-based client application with MINA 2.0 RC1, but it seems to get stuck. Here is my code: public boolean login(final String username, final String password) { // block inbound messages session.getConfig().setUseReadOperation(true); // send the login request fi...

Is this the right way to write a ProtocolDecoder in MINA?

public class CustomProtocolDecoder extends CumulativeProtocolDecoder{ byte currentCmd = -1; int currentSize = -1; boolean isFirst = false; @Override protected boolean doDecode(IoSession is, ByteBuffer bb, ProtocolDecoderOutput pdo) throws Exception { if(currentCmd == -1) { currentCmd = bb.get(); cu...

Mina - HTTP Proxy – what is AbstractHttpLogicHandler for?

I am currently working on building a simple HTTP proxy using Apache Mina, in particular org.apache.mina.proxy, and I have a few questions about how to use some of the components. How do I extract the future address from an incoming HTTP request? I can see how to create a ProxyConnection given a URL, but I can't see how to extract thi...

Connection Pooling in MINA

our project(banking domain) is divided into 4 layers. One of which is a communication(COM) layer which developed in JAVA uses MINA. Our host applications run on UNIX machine which serve request from users via socket communication. The COM layer has a java program which acts both like a client and server. server to Requests from other JAV...

Is it worthy to migrate quickfixj from Mina to Netty?

Hi all, I am writing a FIX buyside GUI based on quickfixj. Although the performance is not an issue to a GUI, I am thinking of migrating the quickfixj from Mina to Netty as I would like to develop it to a buyside engine. The performance of quickfixj is not satisfied with me. It is heard that Netty is better than Mina on performance. Doe...

how to handle multiple iphone client requests using apache mina?

hi friends, i am working on a iphone application,in which iphone application sends a request to the server using socket connection.in server side java code(using apache mina) takes the request and it processes the request and sends the response. now the problem is if multiple iphone users sends request at a time to the server,t...