message-size-increase #3
11
metadapta.go
11
metadapta.go
@ -66,18 +66,21 @@ func (this *a) RemoteAddr() net.Addr {
|
|||||||
func (this *a) OpenTrans() (Trans, error) {
|
func (this *a) OpenTrans() (Trans, error) {
|
||||||
this.transLock.Lock()
|
this.transLock.Lock()
|
||||||
defer this.transLock.Unlock()
|
defer this.transLock.Unlock()
|
||||||
|
if this.transID == int64Max {
|
||||||
|
return nil, fmt.Errorf("could not open transaction: %w", ErrIntegerOverflow)
|
||||||
|
}
|
||||||
id := this.transID
|
id := this.transID
|
||||||
this.transID ++
|
|
||||||
trans := &transA {
|
trans := &transA {
|
||||||
parent: this,
|
parent: this,
|
||||||
id: id,
|
id: id,
|
||||||
incoming: usync.NewGate[incomingMessage](),
|
incoming: usync.NewGate[incomingMessage](),
|
||||||
}
|
}
|
||||||
this.transMap[id] = trans
|
this.transMap[id] = trans
|
||||||
if this.transID == int64Max {
|
if this.party == ClientSide {
|
||||||
return nil, fmt.Errorf("could not open transaction: %w", ErrIntegerOverflow)
|
|
||||||
}
|
|
||||||
this.transID ++
|
this.transID ++
|
||||||
|
} else {
|
||||||
|
this.transID --
|
||||||
|
}
|
||||||
return trans, nil
|
return trans, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user