Commit b622545c authored by Mygod's avatar Mygod

Remove the useless sleep

parent c124e1e8
......@@ -41,9 +41,7 @@ abstract class LocalSocketListener(protected val tag: String) : Thread() {
* Inherited class do not need to close input/output streams as they will be closed automatically.
*/
protected abstract fun accept(socket: LocalSocket)
override final fun run() {
Thread.sleep(500)
LocalSocket().use { localSocket ->
override final fun run() = LocalSocket().use { localSocket ->
val serverSocket = try {
localSocket.bind(LocalSocketAddress(socketFile.absolutePath, LocalSocketAddress.Namespace.FILESYSTEM))
LocalServerSocket(localSocket.fileDescriptor)
......@@ -61,7 +59,6 @@ abstract class LocalSocketListener(protected val tag: String) : Thread() {
}?.use(this::accept)
}
}
}
fun stopThread() {
running = false
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment