wmnsk / go-m3ua Goto Github PK
View Code? Open in Web Editor NEWM3UA implementation in pure Golang.
License: MIT License
M3UA implementation in pure Golang.
License: MIT License
Dear @wmnsk
Hit one bug, not sure where does it root comes from, but I traced to the wire:
When there is 2 messages on the SCTP returned as one packet, like that:
On the m3ua side there is only the ending packet (end dtid in the picture), and the 1st one (request report bcsm report on the pic) is lost.
I will be grateful if you can look at it
Route packets by wrapping IP layer.
It's nice to have utils to convert formatted PC into uint32 and vice versa.
@wmnsk , please review the pull request. Looks like io.EOF is received when the connection breaks (for instance killing the remote end m3ua server). Otherwise client stays connected, just producing errors, upon the write attempt.
Server in this case also immediately senses the remote client disconnected.
hi
can we send gt ( global title ) with this library?
example:
func (a *AspUpAck) SetLength() {
if param := a.AspIdentifier; param != nil {
param.SetLength()
}
if param := a.InfoString; param != nil {
param.SetLength()
}
a.Header.SetLength() //8 byte header
a.Header.Length += uint32(a.MarshalLen()) // MarshalLen return len payload+len header
}
Hi!
Here are a few issues I found with m3ua.Conn:
messages.Data.MarshalBinary will call SetLength on its inner params.Param (eg. RoutingContexts)
Lines 94 to 100 in 3084b69
c.cfg.HeartbeatInfo.Data is read and written concurrently without a mutex or an atomic pointer.
Line 135 in 3084b69
IMHO, seeing these two issues; Conn.cfg should never be modifed by Conn, and only the user of a m3ua.Conn should be able to change the cfg.
I hope it'll help!
Cheers,
Valentin
All goes well, reading and writing works while HB interval set to 0
(excerpt from sample m3ua client)
hbInt = flag.Duration("hb-interval", 0, "Interval for M3UA BEAT. Put 0 to disable")
when not zero, reader code fails after a few reads with the following error
2020/10/27 00:38:55 Read: deadbeef
2020/10/27 00:38:55 Error reading from M3UA conn: M3UA Conn not established
2020/10/27 00:38:55 Recovered from crash occurred on connection with: %!s()
If HB is NOT enabled, that m3UA clent side does not understand the connection disappearance (until any write occures)
Sample code works, since there is HB = 0 in all configs and data direction is client to server
Testing is easy, just set HB interval to 1 and wait for a few packets to pass
Hi!
How I can use MultiHoming in my project? I can use only this method, for one connect:
sctpLocalAddr := &sctp.SCTPAddr{
IPAddrs: "10.10.10.4",,
Port: 9500,
}
sctpRemoteIP := &sctp.SCTPAddr{
IPAddrs: "10.10.10.5",
Port: 9501,
}
conn, err := m3ua.Dial(*ctx, "m3ua", sctpLocalAddr, sctpRemoteIP, m3conf)
Thanks for help!
Hi,
Please could you help me, give simple sample for uses func Read() in conn.go line 61:
func (c *Conn) Read(b []byte) (n int, err error)
How use its and how I can call its ?
Thanks!
In current implementation the Decoder might crash when receiving malformed packets.
We should use gofuzz to find crashes and improve robustness.
hi
i can not import this package
go version go1.22.1 windows/amd64
go mod tidy
go: finding module for package github.com/wmnsk/go-tcap/tcap
go: finding module for package github.com/wmnsk/go-m3ua/messages/params
go: finding module for package github.com/wmnsk/go-m3ua/messages
go: finding module for package github.com/wmnsk/go-m3ua/sctp
go: found github.com/wmnsk/go-m3ua/messages in github.com/wmnsk/go-m3ua v0.1.9
go: found github.com/wmnsk/go-m3ua/messages/params in github.com/wmnsk/go-m3ua v0.1.9
go: finding module for package github.com/wmnsk/go-tcap/tcap
go: finding module for package github.com/wmnsk/go-m3ua/sctp
go: ss7test imports
github.com/wmnsk/go-m3ua/sctp: module github.com/wmnsk/go-m3ua@latest found (v0.1.9), but does not contain package github.com/wmnsk/go-m3ua/sctp
go: ss7test imports
github.com/wmnsk/go-tcap/tcap: module github.com/wmnsk/go-tcap@latest found (v0.0.0-20230328083004-def14b7674dd), but does not contain package github.com/wmnsk/go-tcap/tcap
PS D:\wamp64\www\1403\golang\ss7-m3ua>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.