diff --git a/lib/server.js b/lib/server.js
index <HASH>..<HASH> 100644
--- a/lib/server.js
+++ b/lib/server.js
@@ -14,6 +14,10 @@ var url = require("url");
 module.exports = function() {
     // A server object.
     var self = new events.EventEmitter();
+    // A repository of sockets consisting of opened socket and closed socket
+    // only. A socket has id but it doesn't need to be public now so that array
+    // is used to hide it. TODO
+    self.sockets = [];
     // Options to configure server and client.
     var options = {
         // A heartbeat interval in milliseconds.
@@ -32,9 +36,17 @@ module.exports = function() {
     // A link between Cettia protocol and Cettia transport protocol. `transport` is
     // expected to be passed from Cettia transport server.
     self.handle = function(transport) {
-        // Builds a socket on top of a transport and fires `socket` event to
-        // server.
-        self.emit("socket", createSocket(transport, options));
+        // Builds a socket on top of a transport
+        var socket = createSocket(transport, options);
+        // TODO
+        self.sockets.push(socket);
+        socket.on("close", function() {
+            // It equals to `self.sockets.remove(socket)`.
+            self.sockets.splice(self.sockets.indexOf(socket), 1);
+        });
+        // Fires `socket` event to server. This is the beginning of the socket
+        // life cycle.
+        self.emit("socket", socket);
     };
     return self;
 };
Add a repository for sockets to server #1