This repository has been archived by the owner on May 22, 2020. It is now read-only.
/
conn_flow.go
658 lines (601 loc) · 20.1 KB
/
conn_flow.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
/*
TODO: It probably should have read flow that reads messages and says STAAAHP to channel when read
TODO: here we actually can avoid reconnecting if idle for too long
TODO: confirm that all writes are recorded towards data limit
*/
package tapdance
import (
"context"
"crypto/rand"
"encoding/binary"
"encoding/hex"
"errors"
"io"
"net"
"sync"
"time"
"github.com/golang/protobuf/proto"
"github.com/sergeyfrolov/bsbuffer"
pb "github.com/sergeyfrolov/gotapdance/protobuf"
)
// TapdanceFlowConn represents single TapDance flow.
type TapdanceFlowConn struct {
tdRaw *tdRawConn
bsbuf *bsbuffer.BSBuffer
recvbuf []byte
headerBuf [6]byte
writeSliceChan chan []byte
writeResultChan chan ioOpResult
writtenBytesTotal int
yieldConfirmed chan struct{} // used by flowConn to signal that flow was picked up
readOnly bool // if readOnly -- we don't need to wait for write engine to stop
reconnectSuccess chan bool
reconnectStarted chan struct{}
finSent bool // used only by reader to know if it has already scheduled reconnect
closed chan struct{}
closeOnce sync.Once
closeErr error
flowType flowType
}
/*______________________TapdanceFlowConn Mode Chart _____________________________
|FlowType |Default Tag|Diff from old-school bidirectional | Engines spawned|
|-------------|-----------|------------------------------------|----------------|
|Bidirectional| HTTP GET | | Writer, Reader |
|Upload | HTTP POST |acquires upload | Writer, Reader |
|ReadOnly | HTTP GET |yields upload, writer sync ignored | Reader |
\_____________|___________|____________________________________|_______________*/
// NewTapDanceConn returns TapDance connection, that is ready to be Dial'd
func NewTapDanceConn() (net.Conn, error) {
return makeTdFlow(flowBidirectional, nil, "")
}
// Prepares TD flow: does not make any network calls nor sets up engines
func makeTdFlow(flow flowType, tdRaw *tdRawConn, covert string) (*TapdanceFlowConn, error) {
if tdRaw == nil {
// raw TapDance connection is not given, make a new one
stationPubkey := Assets().GetPubkey()
remoteConnId := make([]byte, 16)
rand.Read(remoteConnId[:])
tdRaw = makeTdRaw(tagHttpGetIncomplete,
stationPubkey[:])
tdRaw.covert = covert
tdRaw.sessionId = sessionsTotal.GetAndInc()
}
flowConn := &TapdanceFlowConn{tdRaw: tdRaw}
flowConn.bsbuf = bsbuffer.NewBSBuffer()
flowConn.closed = make(chan struct{})
flowConn.flowType = flow
return flowConn, nil
}
// Dial establishes direct connection to TapDance station proxy.
// Users are expected to send HTTP CONNECT request next.
func (flowConn *TapdanceFlowConn) DialContext(ctx context.Context) error {
if flowConn.tdRaw.tlsConn == nil {
// if still hasn't dialed
err := flowConn.tdRaw.DialContext(ctx)
if err != nil {
return err
}
}
// don't lose initial msg from station
// strip off state transition and push protobuf up for processing
flowConn.tdRaw.initialMsg.StateTransition = nil
err := flowConn.processProto(flowConn.tdRaw.initialMsg)
if err != nil {
flowConn.closeWithErrorOnce(err)
return err
}
switch flowConn.flowType {
case flowUpload:
fallthrough
case flowBidirectional:
go flowConn.spawnReaderEngine()
flowConn.reconnectSuccess = make(chan bool, 1)
flowConn.reconnectStarted = make(chan struct{})
flowConn.writeSliceChan = make(chan []byte)
flowConn.writeResultChan = make(chan ioOpResult)
go flowConn.spawnWriterEngine()
return nil
case flowReadOnly:
go flowConn.spawnReaderEngine()
return nil
default:
panic("Not implemented")
}
}
type ioOpResult struct {
err error
n int
}
func (flowConn *TapdanceFlowConn) schedReconnectNow() {
flowConn.tdRaw.tlsConn.SetReadDeadline(time.Now())
}
// returns bool indicating success of reconnect
func (flowConn *TapdanceFlowConn) awaitReconnect() bool {
defer func() { flowConn.writtenBytesTotal = 0 }()
for {
select {
case <-flowConn.reconnectStarted:
case <-flowConn.closed:
return false
case reconnectOk := <-flowConn.reconnectSuccess:
return reconnectOk
}
}
}
// Write writes data to the connection.
// Write can be made to time out and return an Error with Timeout() == true
// after a fixed time limit; see SetDeadline and SetWriteDeadline.
func (flowConn *TapdanceFlowConn) spawnWriterEngine() {
defer close(flowConn.writeResultChan)
for {
select {
case <-flowConn.reconnectStarted:
if !flowConn.awaitReconnect() {
return
}
case <-flowConn.closed:
return
case b := <-flowConn.writeSliceChan:
ioResult := ioOpResult{}
bytesSent := 0
canSend := func() int {
// checks the upload limit
// 6 is max header size (protobufs aren't sent here though)
// 1024 is max transition message size
return flowConn.tdRaw.UploadLimit -
flowConn.writtenBytesTotal - 6 - 1024
}
for bytesSent < len(b) {
idxToSend := len(b)
if idxToSend-bytesSent > canSend() {
Logger().Infof("%s reconnecting due to upload limit: "+
"idxToSend (%d) - bytesSent(%d) > UploadLimit(%d) - "+
"writtenBytesTotal(%d) - 6 - 1024 \n",
flowConn.idStr(), idxToSend, bytesSent,
flowConn.tdRaw.UploadLimit, flowConn.writtenBytesTotal)
flowConn.schedReconnectNow()
if !flowConn.awaitReconnect() {
return
}
}
Logger().Debugf("%s WriterEngine: writing\n%s", flowConn.idStr(), hex.Dump(b))
if cs := minInt(canSend(), int(maxInt16)); idxToSend-bytesSent > cs {
// just reconnected and still can't send: time to chunk
idxToSend = bytesSent + cs
}
// TODO: outerProto limit on data size
bufToSend := b[bytesSent:idxToSend]
bufToSendWithHeader := getMsgWithHeader(msgRawData, bufToSend) // TODO: optimize!
headerSize := len(bufToSendWithHeader) - len(bufToSend)
n, err := flowConn.tdRaw.tlsConn.Write(bufToSendWithHeader)
if n >= headerSize {
// TODO: that's kinda hacky
n -= headerSize
}
ioResult.n += n
bytesSent += n
flowConn.writtenBytesTotal += len(bufToSendWithHeader)
if err != nil {
ioResult.err = err
break
}
}
select {
case flowConn.writeResultChan <- ioResult:
case <-flowConn.closed:
return
}
}
}
}
func (flowConn *TapdanceFlowConn) spawnReaderEngine() {
flowConn.updateReadDeadline()
flowConn.recvbuf = make([]byte, 1500)
for {
msgType, msgLen, err := flowConn.readHeader()
if err != nil {
flowConn.closeWithErrorOnce(err)
return
}
if msgLen == 0 {
continue // wtf?
}
switch msgType {
case msgRawData:
buf, err := flowConn.readRawData(msgLen)
if err != nil {
flowConn.closeWithErrorOnce(err)
return
}
Logger().Debugf("%s ReaderEngine: read\n%s",
flowConn.idStr(), hex.Dump(buf))
_, err = flowConn.bsbuf.Write(buf)
if err != nil {
flowConn.closeWithErrorOnce(err)
return
}
case msgProtobuf:
msg, err := flowConn.readProtobuf(msgLen)
if err != nil {
flowConn.closeWithErrorOnce(err)
return
}
err = flowConn.processProto(msg)
if err != nil {
flowConn.closeWithErrorOnce(err)
return
}
default:
flowConn.closeWithErrorOnce(errors.New("Corrupted outer protocol header: " +
msgType.Str()))
return
}
}
}
// Write writes data to the connection.
// Write can be made to time out and return an Error with Timeout() == true
// after a fixed time limit; see SetDeadline and SetWriteDeadline.
func (flowConn *TapdanceFlowConn) Write(b []byte) (int, error) {
select {
case flowConn.writeSliceChan <- b:
case <-flowConn.closed:
return 0, flowConn.closeErr
}
select {
case r := <-flowConn.writeResultChan:
return r.n, r.err
case <-flowConn.closed:
return 0, flowConn.closeErr
}
}
func (flowConn *TapdanceFlowConn) Read(b []byte) (int, error) {
return flowConn.bsbuf.Read(b)
}
func (flowConn *TapdanceFlowConn) readRawData(msgLen int) ([]byte, error) {
if cap(flowConn.recvbuf) < msgLen {
flowConn.recvbuf = make([]byte, msgLen)
}
var err error
var readBytes int
var readBytesTotal int // both header and body
// Get the message itself
for readBytesTotal < msgLen {
readBytes, err = flowConn.tdRaw.tlsConn.Read(flowConn.recvbuf[readBytesTotal:])
readBytesTotal += int(readBytes)
if err != nil {
err = flowConn.actOnReadError(err)
if err != nil {
return flowConn.recvbuf[:readBytesTotal], err
}
}
}
return flowConn.recvbuf[:readBytesTotal], err
}
func (flowConn *TapdanceFlowConn) readProtobuf(msgLen int) (msg pb.StationToClient, err error) {
rbuf := make([]byte, msgLen)
var readBytes int
var readBytesTotal int // both header and body
// Get the message itself
for readBytesTotal < msgLen {
readBytes, err = flowConn.tdRaw.tlsConn.Read(rbuf[readBytesTotal:])
readBytesTotal += readBytes
if err != nil {
err = flowConn.actOnReadError(err)
if err != nil {
return
}
}
}
err = proto.Unmarshal(rbuf[:], &msg)
return
}
func (flowConn *TapdanceFlowConn) readHeader() (msgType msgType, msgLen int, err error) {
// For each message we first read outer protocol header to see if it's protobuf or data
var readBytes int
var readBytesTotal uint32 // both header and body
headerSize := uint32(2)
//TODO: check FIN+last data case
for readBytesTotal < headerSize {
readBytes, err = flowConn.tdRaw.tlsConn.Read(flowConn.headerBuf[readBytesTotal:headerSize])
readBytesTotal += uint32(readBytes)
if err != nil {
err = flowConn.actOnReadError(err)
if err != nil {
return
}
}
}
// Get TIL
typeLen := uint16toInt16(binary.BigEndian.Uint16(flowConn.headerBuf[0:2]))
if typeLen < 0 {
msgType = msgRawData
msgLen = int(-typeLen)
} else if typeLen > 0 {
msgType = msgProtobuf
msgLen = int(typeLen)
} else {
// protobuf with size over 32KB, not fitting into 2-byte TL
msgType = msgProtobuf
headerSize += 4
for readBytesTotal < headerSize {
readBytes, err = flowConn.tdRaw.tlsConn.Read(flowConn.headerBuf[readBytesTotal:headerSize])
readBytesTotal += uint32(readBytes)
if err != nil {
err = flowConn.actOnReadError(err)
if err != nil {
return
}
}
}
msgLen = int(binary.BigEndian.Uint32(flowConn.headerBuf[2:6]))
}
return
}
// Allows scheduling/doing reconnects in the middle of reads
func (flowConn *TapdanceFlowConn) actOnReadError(err error) error {
if err == nil {
return nil
}
willScheduleReconnect := false
if netErr, ok := err.(net.Error); ok && netErr.Timeout() {
// Timeout is used as a signal to schedule reconnect, as reconnect is indeed time dependent.
// One can also SetDeadline(NOW) to schedule deadline NOW.
// After EXPECT_RECONNECT and FIN are sent, deadline is used to signal that flow timed out
// waiting for FIN back.
willScheduleReconnect = true
}
// "EOF is the error returned by Read when no more input is available. Functions should
// return EOF only to signal a graceful end of input." (e.g. FIN was received)
// "ErrUnexpectedEOF means that EOF was encountered in the middle of reading a fixed-size
// block or data structure."
willReconnect := (err == io.EOF || err == io.ErrUnexpectedEOF)
if willScheduleReconnect {
Logger().Infoln(flowConn.tdRaw.idStr() + " scheduling reconnect")
if flowConn.finSent {
// timeout is hit another time before reconnect
return errors.New("reconnect scheduling: timed out waiting for FIN back")
}
if flowConn.flowType != flowReadOnly {
// notify writer, if there is a writer
select {
case <-flowConn.closed:
return errors.New("reconnect scheduling: closed while notifiyng writer")
case flowConn.reconnectStarted <- struct{}{}:
}
}
transition := pb.C2S_Transition_C2S_EXPECT_RECONNECT
if flowConn.flowType == flowUpload {
transition = pb.C2S_Transition_C2S_EXPECT_UPLOADONLY_RECONN
}
_, err = flowConn.tdRaw.writeTransition(transition)
if err != nil {
return errors.New("reconnect scheduling: failed to send " +
transition.String() + ": " + err.Error())
}
if flowConn.flowType == flowUpload {
// for upload-only flows we reconnect right away
willReconnect = true
} else {
flowConn.tdRaw.tlsConn.SetReadDeadline(time.Now().Add(
getRandomDuration(waitForFINDieMin, waitForFINDieMax)))
err = flowConn.tdRaw.closeWrite()
if err != nil {
Logger().Infoln(flowConn.tdRaw.idStr() + " reconnect scheduling:" +
"failed to send FIN: " + err.Error() +
". Closing roughly and moving on.")
flowConn.tdRaw.Close()
}
flowConn.finSent = true
return nil
}
}
if willReconnect {
if flowConn.flowType != flowReadOnly {
// notify writer, if there is a writer
select {
case <-flowConn.closed:
return errors.New("reconnect scheduling: closed while notifiyng writer")
case flowConn.reconnectStarted <- struct{}{}:
}
}
if (flowConn.flowType != flowUpload && !flowConn.finSent) ||
err == io.ErrUnexpectedEOF {
Logger().Infoln(flowConn.tdRaw.idStr() + " reconnect: FIN is unexpected")
}
err = flowConn.tdRaw.RedialContext(context.Background())
if flowConn.flowType != flowReadOnly {
// wake up writer engine
select {
case <-flowConn.closed:
case flowConn.reconnectSuccess <- (err == nil):
}
}
if err != nil {
return errors.New("reconnect: failed to Redial: " + err.Error())
}
flowConn.finSent = false
// strip off state transition and push protobuf up for processing
flowConn.tdRaw.initialMsg.StateTransition = nil
err = flowConn.processProto(flowConn.tdRaw.initialMsg)
if err == nil {
flowConn.updateReadDeadline()
return nil
} else if err == errMsgClose {
// errMsgClose actually won't show up here
Logger().Infoln(flowConn.tdRaw.idStr() + " closing cleanly with MSG_CLOSE")
return io.EOF
} // else: proceed and exit as a crash
}
return flowConn.closeWithErrorOnce(err)
}
// Sets read deadline to {when raw connection was establihsed} + {timeout} - {small random value}
func (flowConn *TapdanceFlowConn) updateReadDeadline() {
amortizationVal := 0.9
const minSubtrahend = 50
const maxSubtrahend = 9500
deadline := flowConn.tdRaw.establishedAt.Add(time.Millisecond *
time.Duration(int(float64(flowConn.tdRaw.decoySpec.GetTimeout())*amortizationVal)-
getRandInt(minSubtrahend, maxSubtrahend)))
flowConn.tdRaw.tlsConn.SetReadDeadline(deadline)
}
func (flowConn *TapdanceFlowConn) acquireUpload() error {
_, err := flowConn.tdRaw.writeTransition(pb.C2S_Transition_C2S_ACQUIRE_UPLOAD)
if err != nil {
Logger().Infoln(flowConn.idStr() + " Failed attempt to acquire upload:" + err.Error())
} else {
Logger().Infoln(flowConn.idStr() + " Sent acquire upload request")
}
return err
}
func (flowConn *TapdanceFlowConn) yieldUpload() error {
_, err := flowConn.tdRaw.writeTransition(pb.C2S_Transition_C2S_YIELD_UPLOAD)
if err != nil {
Logger().Infoln(flowConn.idStr() + " Failed attempt to yield upload:" + err.Error())
} else {
Logger().Infoln(flowConn.idStr() + " Sent yield upload request")
}
return err
}
// TODO: implement on station, currently unused
// wait for flowConn to confirm that flow was noticed
func (flowConn *TapdanceFlowConn) waitForYieldConfirmation() error {
// camouflage issue
timeout := time.After(20 * time.Second)
select {
case <-timeout:
return errors.New("yield confirmation timeout")
case <-flowConn.yieldConfirmed:
Logger().Infoln(flowConn.idStr() +
" Successfully received yield confirmation from reader flow!")
return nil
case <-flowConn.closed:
return flowConn.closeErr
}
}
// Closes connection, channel and sets error ONCE, e.g. error won't be overwritten
func (flowConn *TapdanceFlowConn) closeWithErrorOnce(err error) error {
if err == nil {
// safeguard, shouldn't happen
err = errors.New("closed with nil error!")
}
flowConn.closeOnce.Do(func() {
flowConn.closeErr = errors.New(flowConn.idStr() + " " + err.Error())
flowConn.bsbuf.Unblock()
close(flowConn.closed)
flowConn.tdRaw.Close()
})
return flowConn.closeErr
}
// Close closes the connection.
// Any blocked Read or Write operations will be unblocked and return errors.
func (flowConn *TapdanceFlowConn) Close() error {
return flowConn.closeWithErrorOnce(errors.New("closed by application layer"))
}
func (flowConn *TapdanceFlowConn) idStr() string {
return flowConn.tdRaw.idStr()
}
func (flowConn *TapdanceFlowConn) processProto(msg pb.StationToClient) error {
handleConfigInfo := func(conf *pb.ClientConf) {
currGen := Assets().GetGeneration()
if conf.GetGeneration() < currGen {
Logger().Infoln(flowConn.idStr()+" not appliying new config due"+
" to lower generation: ", conf.GetGeneration(), " "+
"(have:", currGen, ")")
return
} else if conf.GetGeneration() < currGen {
Logger().Infoln(flowConn.idStr()+" not appliying new config due"+
" to currently having same generation: ", currGen)
return
}
_err := Assets().SetClientConf(conf)
if _err != nil {
Logger().Warningln(flowConn.idStr() +
" could not persistently set ClientConf: " + _err.Error())
}
}
Logger().Debugln(flowConn.idStr() + " processing incoming protobuf: " + msg.String())
// handle ConfigInfo
if confInfo := msg.ConfigInfo; confInfo != nil {
handleConfigInfo(confInfo)
// TODO: if we ever get a ``safe'' decoy rotation - code below has to be rewritten
if !Assets().IsDecoyInList(flowConn.tdRaw.decoySpec) {
Logger().Warningln(flowConn.idStr() + " current decoy is no " +
"longer in the list, changing it! Read flow probably will break!")
// if current decoy is no longer in the list
flowConn.tdRaw.decoySpec = Assets().GetDecoy()
}
if !Assets().IsDecoyInList(flowConn.tdRaw.decoySpec) {
Logger().Warningln(flowConn.idStr() + " current decoy is no " +
"longer in the list, changing it! Write flow probably will break!")
// if current decoy is no longer in the list
flowConn.tdRaw.decoySpec = Assets().GetDecoy()
}
}
// note that flowConn don't see first-message transitions, such as INIT or RECONNECT
stateTransition := msg.GetStateTransition()
switch stateTransition {
case pb.S2C_Transition_S2C_NO_CHANGE:
// carry on
case pb.S2C_Transition_S2C_SESSION_CLOSE:
Logger().Infof(flowConn.idStr() + " received MSG_CLOSE")
return errMsgClose
case pb.S2C_Transition_S2C_ERROR:
err := errors.New("message from station:" +
msg.GetErrReason().String())
Logger().Errorln(flowConn.idStr() + " " + err.Error())
flowConn.closeWithErrorOnce(err)
return err
case pb.S2C_Transition_S2C_CONFIRM_RECONNECT:
fallthrough
case pb.S2C_Transition_S2C_SESSION_INIT:
fallthrough
default:
err := errors.New("Unexpected StateTransition " +
"in initialized Conn:" + stateTransition.String())
Logger().Errorln(flowConn.idStr() + " " + err.Error())
flowConn.closeWithErrorOnce(err)
return err
}
return nil
}
// LocalAddr returns the local network address.
func (flowConn *TapdanceFlowConn) LocalAddr() net.Addr {
return flowConn.tdRaw.tlsConn.LocalAddr()
}
// RemoteAddr returns the address of current decoy.
// Not goroutine-safe, mostly here to satisfy net.Conn
func (flowConn *TapdanceFlowConn) RemoteAddr() net.Addr {
return flowConn.tdRaw.tlsConn.RemoteAddr()
}
// SetDeadline is supposed to set the read and write deadlines
// associated with the connection. It is equivalent to calling
// both SetReadDeadline and SetWriteDeadline.
//
// TODO: In reality, SetDeadline doesn't do that yet, but
// existence of this function is mandatory to implement net.Conn
//
// A deadline is an absolute time after which I/O operations
// fail with a timeout (see type Error) instead of
// blocking. The deadline applies to all future I/O, not just
// the immediately following call to Read or Write.
//
// An idle timeout can be implemented by repeatedly extending
// the deadline after successful Read or Write calls.
//
// A zero value for t means I/O operations will not time out.
//
func (flowConn *TapdanceFlowConn) SetDeadline(t time.Time) error {
return errNotImplemented
}
// SetReadDeadline sets the deadline for future Read calls.
// A zero value for t means Read will not time out.
func (flowConn *TapdanceFlowConn) SetReadDeadline(t time.Time) error {
return errNotImplemented
}
// SetWriteDeadline sets the deadline for future Write calls.
// Even if write times out, it may return n > 0, indicating that
// some of the data was successfully written.
// A zero value for t means Write will not time out.
func (flowConn *TapdanceFlowConn) SetWriteDeadline(t time.Time) error {
return errNotImplemented
}