// Copyright (c) 2011 Andrew Paprocki

var EventEmitter = require('events').EventEmitter;
var util = require('util');
var dgram = require('dgram');
var parser = require('./parser');

function Server(options) {
    if (options) {
        if (typeof(options) !== 'object')
            throw new TypeError('Server options must be an object');
    } else {
        options = {};
    }

    var self = this;
    EventEmitter.call(this, options);

    this.server = dgram.createSocket('udp4');
    this.server.on('message', function(msg, rinfo) {
      try {
          var data = parser.parse( msg, rinfo );
          self.emit('message',data);
      } catch (e) {
          self.emit('error',e);
      }
    });
    this.server.on('listening', function() {
        var address = self.server.address();
        self.emit('listening', address.address + ':' + address.port);
    });
}
util.inherits(Server, EventEmitter);
module.exports = Server;

Server.prototype.bind = function(host,port) {
    var _this = this;
    if (!port) port = 67;
    this.server.bind(port, host, function() {
    	_this.server.setBroadcast(true);
    });
}

@@ -580,17 +580,16 @@
 r.parse(
- 
 msg, rin
@@ -590,17 +590,16 @@
 g, rinfo
- 
 );%0A     
@@ -623,16 +623,17 @@
 essage',
+ 
 data);%0A 
@@ -653,32 +653,37 @@
 (e) %7B%0A          
+if (!
 self.emit('error
@@ -684,19 +684,57 @@
 'error',
+ 
 e)
-;
+) %7B%0A              throw e;%0A          %7D
 %0A      %7D

Update server.js