You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have run server side with following code, its can run perfectly
//////////////////////////////////Server.js ///////////////////////////////////////////////////////
var port = 8080,
app = require('express')(),
io = require('socket.io').listen(app.listen(port)),
logger = require('winston'),
program = require('commander');
program.version('0.1')
.option('-p, --port [num]', 'Set the server port (default 8080)')
.option('-H, --disableheartbeats', 'Disable heartbeats')
.parse(process.argv)
var server = "localhost";
if(program.args.length==1) {
server = program.args[0];
} else if (program.args.length==0) {
logger.warn("Defaulting to localhost.");
}
if(program.port) {
logger.info("Setting port to " + program.port);
port = program.port;
}
And also run the Client Side (Java Code) , i got this error. Can anyone help me.
---------------- CONCURRENCY 1 ----------------
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: com/netiq/websocket/WebSocketClient
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.websocketbenchmark.client.SocketIOLoadTester.makeConnections(SocketIOLoadTester.java:138)
at org.websocketbenchmark.client.SocketIOLoadTester.run(SocketIOLoadTester.java:92)
Caused by: java.lang.ClassNotFoundException: com.netiq.websocket.WebSocketClient
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 14 more
Thank you very much.
Wa
The text was updated successfully, but these errors were encountered:
Are you using the most recent version of socket.io? The websocket library that the client uses doesn't seem to work with socket.io 1.0 and I haven't had time to reverse engineer their new protocol to make this work.
Hi
I have run server side with following code, its can run perfectly
//////////////////////////////////Server.js ///////////////////////////////////////////////////////
var port = 8080,
app = require('express')(),
io = require('socket.io').listen(app.listen(port)),
logger = require('winston'),
program = require('commander');
logger.cli();
logger.default.transports.console.timestamp = true;
program.version('0.1')
.option('-p, --port [num]', 'Set the server port (default 8080)')
.option('-H, --disableheartbeats', 'Disable heartbeats')
.parse(process.argv)
var server = "localhost";
if(program.args.length==1) {
server = program.args[0];
} else if (program.args.length==0) {
logger.warn("Defaulting to localhost.");
}
if(program.port) {
logger.info("Setting port to " + program.port);
port = program.port;
}
if(program.disableheartbeats) {
io.set("heartbeats", false)
}
io.set("log level", 0);
app.get('/', function (req, res) {
res.sendfile(__dirname + '/index.html');
});
var connectedUsersCount = 0;
var messagesPerSecond = 0;
io.sockets.on('connection', function(socket) {
connectedUsersCount++;
});
setTimeout(logStatus, 1000);
function logStatus() {
setTimeout(logStatus, 1000);
}
/////////////////////////////////////////////////////////////////////////////////////////
And also run the Client Side (Java Code) , i got this error. Can anyone help me.
---------------- CONCURRENCY 1 ----------------
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: com/netiq/websocket/WebSocketClient
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.websocketbenchmark.client.SocketIOLoadTester.makeConnections(SocketIOLoadTester.java:138)
at org.websocketbenchmark.client.SocketIOLoadTester.run(SocketIOLoadTester.java:92)
Caused by: java.lang.ClassNotFoundException: com.netiq.websocket.WebSocketClient
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 14 more
Thank you very much.
Wa
The text was updated successfully, but these errors were encountered: