質問

I need to store SDP structures returned by WebRTC. The specification does not define a maximum length but obviously the database needs one.

What is a reasonable length limit in this case? How do you generally go about deciding length limits in such undefined cases?

役に立ちましたか?

解決 3

Answering my own question.

You can either estimate the maximum length using historical values, or use a BLOB. In my case, I ended up choosing a theoretical limit of 4000 bytes.

他のヒント

Usually, there is no need to store the whole SDP packet. The fact that there is not upper limit on the SDP packet length isn't an issue in most cases.

In this case, the simplest thing you could do is to use a blob.

Unless the SessionId and Originator are changing in the SDP among other items it may not work.

The other stack might see the SDP and accept it but be unable to communicate with the remote client.

The SDP will most likely have to be re-written to some degree. If you want an alternative you can convert the SDP to XML and store the XML in the database and then use a function to query the xml and write it out as a SDP dynamicaly....

If XML is out of the question and you really only care about store see about using the filestream option in SQLServer http://www.databasejournal.com/features/mssql/filestream-and-filetable-in-sql-server-2012.html

Furthermore after reading this Draft Spec which is relevant only to WebRTC...

https://datatracker.ietf.org/doc/html/draft-nandakumar-rtcweb-sdp-00#page-3

I believe you will definitely have to rewrite portions of the SDP because of the Key Exchange used in the SDP.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top