@@ -14,7 +14,7 @@ import (
1414// The resendTimeout parameter defines the duration to wait before resending data
1515// if the corresponding ACK for the data is not received.
1616func NewClientConn (ctx context.Context , n uint8 , sendFunc sendBytesFunc ,
17- receiveFunc recvBytesFunc , opts ... Option ) (* GoBackNConn , error ) {
17+ receiveFunc recvBytesFunc , opts ... Option ) (GBN , error ) {
1818
1919 if n == math .MaxUint8 {
2020 return nil , fmt .Errorf ("n must be smaller than %d" ,
@@ -28,14 +28,15 @@ func NewClientConn(ctx context.Context, n uint8, sendFunc sendBytesFunc,
2828 o (cfg )
2929 }
3030
31- conn := newGoBackNConn (ctx , cfg , "client" )
31+ conn := newGBN (ctx , cfg , "client" )
3232
3333 if err := conn .clientHandshake (); err != nil {
3434 if err := conn .Close (); err != nil {
3535 conn .log .Errorf ("error closing gbn ClientConn: %v" , err )
3636 }
3737 return nil , err
3838 }
39+
3940 conn .start ()
4041
4142 return conn , nil
@@ -50,7 +51,7 @@ func NewClientConn(ctx context.Context, n uint8, sendFunc sendBytesFunc,
5051// SYNACK.
5152// 3b. If the client does not receive SYN from the server within a given
5253// timeout, then the client restarts the handshake from step 1.
53- func (g * GoBackNConn ) clientHandshake () error {
54+ func (g * gbn ) clientHandshake () error {
5455 // Spin off the recv function in a goroutine so that we can use
5556 // a select to choose to timeout waiting for data from the receive
5657 // stream. This is needed instead of a context timeout because the
0 commit comments