Skip to content
Snippets Groups Projects
Commit aaea080e authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Merge branch 'socket.io-1.0' into integration

parents ed3cc18c ea3bdf42
Branches
Tags
No related merge requests found
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
<dependency> <dependency>
<groupId>com.corundumstudio.socketio</groupId> <groupId>com.corundumstudio.socketio</groupId>
<artifactId>netty-socketio</artifactId> <artifactId>netty-socketio</artifactId>
<version>1.0.1</version> <version>1.7.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.inject</groupId> <groupId>javax.inject</groupId>
......
package de.thm.arsnova.socket; package de.thm.arsnova.socket;
import io.netty.channel.ChannelOption;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.InputStream; import java.io.InputStream;
...@@ -15,16 +17,18 @@ import org.slf4j.Logger; ...@@ -15,16 +17,18 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required; import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Component;
import com.corundumstudio.socketio.AckRequest; import com.corundumstudio.socketio.AckRequest;
import com.corundumstudio.socketio.Configuration; import com.corundumstudio.socketio.Configuration;
import com.corundumstudio.socketio.SocketConfig;
import com.corundumstudio.socketio.SocketIOClient; import com.corundumstudio.socketio.SocketIOClient;
import com.corundumstudio.socketio.SocketIOServer; import com.corundumstudio.socketio.SocketIOServer;
import com.corundumstudio.socketio.listener.ConnectListener; import com.corundumstudio.socketio.listener.ConnectListener;
import com.corundumstudio.socketio.listener.DataListener; import com.corundumstudio.socketio.listener.DataListener;
import com.corundumstudio.socketio.listener.DisconnectListener; import com.corundumstudio.socketio.listener.DisconnectListener;
import com.corundumstudio.socketio.parser.Packet; import com.corundumstudio.socketio.protocol.Packet;
import com.corundumstudio.socketio.parser.PacketType; import com.corundumstudio.socketio.protocol.PacketType;
import de.thm.arsnova.entities.User; import de.thm.arsnova.entities.User;
import de.thm.arsnova.exceptions.NoContentException; import de.thm.arsnova.exceptions.NoContentException;
...@@ -34,6 +38,7 @@ import de.thm.arsnova.services.IUserService; ...@@ -34,6 +38,7 @@ import de.thm.arsnova.services.IUserService;
import de.thm.arsnova.socket.message.Feedback; import de.thm.arsnova.socket.message.Feedback;
import de.thm.arsnova.socket.message.Session; import de.thm.arsnova.socket.message.Session;
@Component
public class ARSnovaSocketIOServer { public class ARSnovaSocketIOServer {
@Autowired @Autowired
...@@ -81,6 +86,9 @@ public class ARSnovaSocketIOServer { ...@@ -81,6 +86,9 @@ public class ARSnovaSocketIOServer {
*/ */
System.setProperty("java.net.preferIPv4Stack", "true"); System.setProperty("java.net.preferIPv4Stack", "true");
SocketConfig soConfig = new SocketConfig();
soConfig.setReuseAddress(true);
config.setSocketConfig(soConfig);
config.setPort(portNumber); config.setPort(portNumber);
config.setHostname(hostIp); config.setHostname(hostIp);
if (useSSL) { if (useSSL) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment