artsrun-gasparyan / jwebsocket

Automatically exported from code.google.com/p/jwebsocket
0 stars 0 forks source link

TCP Engine - listens on all IPs - should only listen on specified IP #189

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In the config file we cannot specify which IP the WS server needs to listen on. 
Some servers have multiple TCP sockets on the same port, but with different IP 
addresses. eg:

IP1 : 80 ==> apache
IP2 : 80 ==> jwebsocketserver

Now jwebsocket just binds to every ip address, which is undesired behavior in 
this example.

This can be fixed fairly easy in the TCPEngine class:
public TCPEngine(EngineConfiguration aConfiguration) {
…
mTCPServerSocket = new ServerSocket(mTCPListenerPort);

This should be:
mTCPServerSocket = new ServerSocket(mTCPListenerPort),backlog,bindAddr)

Where bindaddr is specified in the xml settings file

http://docs.oracle.com/javase/1.4.2/docs/api/java/net/ServerSocket.html 

Original issue reported on code.google.com by ooste...@gmail.com on 10 Aug 2012 at 1:28