feat: 초기 프로젝트 설정 및 룰.md 파일 추가
This commit is contained in:
18
api.hyungi.net/node_modules/nssocket/examples/bla.js
generated
vendored
Normal file
18
api.hyungi.net/node_modules/nssocket/examples/bla.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
var nssocket = require('../lib/nssocket');
|
||||
|
||||
var sockets = [];
|
||||
var server = nssocket.createServer(function (socket) {
|
||||
|
||||
sockets.push(socket);
|
||||
|
||||
socket.data('Connecting', function (data) {
|
||||
console.log("There are now", sockets.length);
|
||||
|
||||
for(var i=0, l=sockets.length; i<l; i++) {
|
||||
sockets[i].send('Broadcasting', data);
|
||||
}
|
||||
console.dir(data);
|
||||
});
|
||||
|
||||
}).listen(4949);
|
||||
Reference in New Issue
Block a user