Skip to content

Commit 6f9320a

Browse files
AdamGrzybkowskidsrees
authored andcommitted
Initialize reconnectTimer in PhxSocket (#33)
1 parent 539b8df commit 6f9320a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/kotlin/org/phoenixframework/PhxSocket.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ open class PhxSocket(
127127
httpUrl = httpBuilder.build()
128128
}
129129

130+
reconnectTimer = PhxTimer(
131+
callback = {
132+
disconnect().also {
133+
connect()
134+
}
135+
},
136+
timerCalculation = reconnectAfterMs
137+
)
130138

131139
// Hold reference to where the Socket is pointing to
132140
this.endpoint = httpUrl.url()

0 commit comments

Comments
 (0)