# HG changeset patch # User wenzelm # Date 1502034124 -7200 # Node ID 7ed911242266620e1f7a892e95c274c90277c64f # Parent 95847ffa62dcd87ff6ac0dd24621c5ea264ddab4 clarified signature; diff -r 95847ffa62dc -r 7ed911242266 src/Pure/Tools/server.scala --- a/src/Pure/Tools/server.scala Sun Aug 06 17:38:54 2017 +0200 +++ b/src/Pure/Tools/server.scala Sun Aug 06 17:42:04 2017 +0200 @@ -48,14 +48,14 @@ def find(db: SQLite.Database, name: String): Option[Data.Entry] = list(db).find(entry => entry.name == name) - def start(name: String = "", port: Int = 0, password: String = ""): (Data.Entry, Option[Thread]) = + def start(name: String = "", port: Int = 0): (Data.Entry, Option[Thread]) = { using(SQLite.open_database(Data.database))(db => db.transaction { find(db, name) match { case Some(entry) => (entry, None) case None => - val server = new Server(port, password) + val server = new Server(port) val entry = Data.Entry(name, server.port, server.password) Isabelle_System.bash("chmod 600 " + File.bash_path(Data.database)).check @@ -125,13 +125,13 @@ }) } -class Server private(_port: Int, _password: String) +class Server private(_port: Int) { private val server_socket = new ServerSocket(_port, 50, InetAddress.getByName("127.0.0.1")) def port: Int = server_socket.getLocalPort def close { server_socket.close } - val password: String = proper_string(_password) getOrElse Library.UUID() + val password: String = Library.UUID() private def handle_connection(socket: Socket) {