     // Create the child process.
     let cfd = rawAccept()
     if cfd == -1 {
-      throw ServerSocketError.AcceptError
+      throw ServerSocketError.Accept
     }
     let pid = fork()
     if pid < 0 {
-      throw ServerSocketError.ForkError
+      throw ServerSocketError.Fork
     }
     if pid == 0 {
       // This is the child process.

    socketAddress = SocketAddress(hostName: hostName)
    fd = socket(AF_INET, Int32(SOCK_STREAM.rawValue), 0)
    if fd == -1 {
      throw ServerSocketError.SocketStartError
    }
    if fcntl(fd, F_SETFD, FD_CLOEXEC) == -1 {
      throw ServerSocketError.CloexecSetupError
    }
    var v = 1
    if setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &v,
        socklen_t(sizeofValue(v))) == -1 {
      throw ServerSocketError.ReuseAddrSetupError
    }
    if let sa = socketAddress.ip4ToCSocketAddress(port) {
      cSocketAddress = sa
      var address = sa
      let addrlen = UInt32(sizeofValue(address))
      if bind(fd, &address, addrlen) == -1 {
        throw ServerSocketError.BindError(message: "Port may be in use by " +
            "another process.")
      }
      listen(fd, SOMAXCONN)
    } else {
      throw ServerSocketError.AddressError(message:
          socketAddress.errorMessage ?? "")
    }
  }



enum ServerSocketError: ErrorType {
  case Address(message: String)
  case Bind(message: String)
  case SocketStart
  case CloexecSetup
  case ReuseAddrSetup
  case Fork
  case Accept
}
