Skip to content

Commit 65d01c6

Browse files
committed
Make stream.Write public
1 parent 3e731a0 commit 65d01c6

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

client_conn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func newClientConnWithSetup(c net.Conn, config *ConnConfig) (*ClientConn, error)
3939
}
4040
ctrlStream.handler.ChangeState(streamStateClientNotConnected)
4141

42-
conn.streamer.controlStreamWriter = ctrlStream.write
42+
conn.streamer.controlStreamWriter = ctrlStream.Write
4343

4444
cc := &ClientConn{
4545
conn: conn,

server_conn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (sc *serverConn) Serve() error {
3737
}
3838
ctrlStream.handler.ChangeState(streamStateServerNotConnected)
3939

40-
sc.conn.streamer.controlStreamWriter = ctrlStream.write
40+
sc.conn.streamer.controlStreamWriter = ctrlStream.Write
4141

4242
if sc.conn.handler != nil {
4343
sc.conn.handler.OnServe(sc.conn)

stream.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ func newStream(streamID uint32, conn *Conn) *Stream {
4646
}
4747

4848
func (s *Stream) WriteWinAckSize(chunkStreamID int, timestamp uint32, msg *message.WinAckSize) error {
49-
return s.write(chunkStreamID, timestamp, msg)
49+
return s.Write(chunkStreamID, timestamp, msg)
5050
}
5151

5252
func (s *Stream) WriteSetPeerBandwidth(chunkStreamID int, timestamp uint32, msg *message.SetPeerBandwidth) error {
53-
return s.write(chunkStreamID, timestamp, msg)
53+
return s.Write(chunkStreamID, timestamp, msg)
5454
}
5555

5656
func (s *Stream) WriteUserCtrl(chunkStreamID int, timestamp uint32, msg *message.UserCtrl) error {
57-
return s.write(chunkStreamID, timestamp, msg)
57+
return s.Write(chunkStreamID, timestamp, msg)
5858
}
5959

6060
func (s *Stream) Connect(
@@ -249,7 +249,7 @@ func (s *Stream) writeCommandMessage(
249249
return err
250250
}
251251

252-
return s.write(chunkStreamID, timestamp, &message.CommandMessage{
252+
return s.Write(chunkStreamID, timestamp, &message.CommandMessage{
253253
CommandName: commandName,
254254
TransactionID: transactionID,
255255
Encoding: s.encTy,
@@ -269,14 +269,14 @@ func (s *Stream) WriteDataMessage(
269269
return err
270270
}
271271

272-
return s.write(chunkStreamID, timestamp, &message.DataMessage{
272+
return s.Write(chunkStreamID, timestamp, &message.DataMessage{
273273
Name: name,
274274
Encoding: message.EncodingTypeAMF0,
275275
Body: buf,
276276
})
277277
}
278278

279-
func (s *Stream) write(chunkStreamID int, timestamp uint32, msg message.Message) error {
279+
func (s *Stream) Write(chunkStreamID int, timestamp uint32, msg message.Message) error {
280280
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) // TODO: Fix 5s
281281
defer cancel()
282282

0 commit comments

Comments
 (0)