cb928b0
Branches > main > cb928b0 > files
Remove unused promise from connection code
Commit: cb928b05022897a59904b56609b17fc503845c50
Parent: 315fbaa
1 changed file:
src/net/bowmap/transport/connection.clj view file
@@ -16,16 +16,13 @@ (defn connection "Creates a connection object from a java.net.Socket Connections have a channel of serverbound packets, and a channel of clientbound packets.- Connections can be closed with ::close-fn, and the promise at ::closed will deliver with- the connection's known uuid, or nil if the connection does not have one."+ Connections can be idempotently closed with ::close-fn, which returns the connection uuid, if it exists." [socket] (let [input-stream (Socket/.getInputStream socket) output-stream (Socket/.getOutputStream socket) state (atom {::phase/phase ::phase/handshaking})- closed-promise (promise) close (fn [] (Socket/.close socket)- (deliver closed-promise (@state ::player/uuid)) (@state ::player/uuid)) conn {::close-fn close ::send-packet (fn [packet]