Skip to content

Commit

Permalink
Added better exception handling. Included a quick example with mongodb.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sghazzawi committed Oct 2, 2011
1 parent ec8b829 commit ab03e12
Show file tree
Hide file tree
Showing 204 changed files with 38,188 additions and 5 deletions.
13 changes: 11 additions & 2 deletions netflow.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
require("NetFlowPacket");

var netflow=function(callback){
var dgram=require("dgram");
var server = dgram.createSocket("udp4");

server.on("message", function (mesg, rinfo) {
x=new NetFlowPacket(mesg);
console.log(x);
try{
callback(null, x);
}
catch(err){
callback(error,null);
}
// console.log(x);
});

server.on("listening", function () {
Expand All @@ -13,4 +21,5 @@ server.on("listening", function () {
address.address + ":" + address.port);
});

server.bind(2055);
this.listen=function(port){server.bind(port)};
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions node_modules/mongodb/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

133 changes: 133 additions & 0 deletions node_modules/mongodb/HISTORY

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions node_modules/mongodb/Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ab03e12

Please sign in to comment.