Cleanup: introduce Connection.isHandshakeCompleted

This commit is contained in:
Mark Spanbroek 2020-10-07 11:33:30 +02:00 committed by markspanbroek
parent 2ed74d0709
commit 9ca3fa3e8d
2 changed files with 8 additions and 3 deletions

View File

@ -0,0 +1,5 @@
import ngtcp2
import connection
proc isHandshakeCompleted*(connection: Connection): bool =
ngtcp2_conn_get_handshake_completed(connection.conn).bool

View File

@ -4,8 +4,8 @@ import helpers/server
import helpers/client
import helpers/ids
import helpers/path
import helpers/connection
import helpers/udp
import helpers/handshake
suite "ngtcp2":
@ -43,9 +43,9 @@ suite "ngtcp2":
echo "--- CLIENT 3>>> SERVER"
datagramLength = client.write(datagram, datagramInfo)
check client.conn.ngtcp2_conn_get_handshake_completed().bool
check client.isHandshakeCompleted
echo "--- CLIENT >>>3 SERVER"
server.read(datagram[0..<datagramLength], datagramInfo)
check server.conn.ngtcp2_conn_get_handshake_completed().bool
check server.isHandshakeCompleted