Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException handling multiple connections. #11

Open
kikekr opened this issue Apr 18, 2018 · 0 comments
Open

NullPointerException handling multiple connections. #11

kikekr opened this issue Apr 18, 2018 · 0 comments

Comments

@kikekr
Copy link

kikekr commented Apr 18, 2018

Hi,
When I try to establish more than one simultaneous connection to my llrp server the NioHandler launches a NullPointerException with the next message:

Error while processing network channel
java.lang.NullPointerException
	at net.enilink.llrp4j.net.NioServer.run(NioServer.java:80)
	at java.lang.Thread.run(Thread.java:745)

With only one connection it works properly. Is your class 'LlrpServer' currently multithread?
This is my endpoint implementation:

LlrpEndpoint() {

	@Override
	public void errorOccured(String arg0, Throwable arg1) {
		System.err.println(arg0);
		System.err.println(arg1.getMessage());
		arg1.printStackTrace();
	}

	@Override
	public void messageReceived(LlrpMessage message) {
		String messageName = message.getClass().getSimpleName(); 
		Class<?> responseType = message.getResponseType();
		LlrpMessage response = handleMessage(message);
		if (response != null) {
			server.send(response);
		}
	}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant