How to recover for ICE Failed? - webrtc

I have developed a WebRTC based sample, but I face problems like ICE Failed often, and then the entire app becomes unstable, how/what can I do to recover from this failure? AFAIK this is not related to code(at least I think so) still, if you need my code I can post it here. Further more I have gone through this question and google groups email but I didn't get much of it. Can anyone please explain this.

you need to do an ICE restart. There is a canonical sample for that available here

Related

What are the WebRTC samples at https://webrtc.github.io/samples/ supposed to do?

I am trying to work with the WebRTC samples from https://webrtc.github.io/samples/.
IIUC, these should be quite up to date and original minimal samples that will help to understand the technology.
So I am looking for example at https://webrtc.github.io/samples/src/content/peerconnection/pc1/
which is supposed to be Peer Connection Demo.
Despite this is supposed to be Peer connection demo, all it does is to show me my own camera on one machine. Even if I start it on two machines, I see my own camera picture on each one.
If I read the code, I can find hints that this is supposed to make a connection between two machines, yet I fail to understand how. Nowhere on the site it is asking for a peer name, room name or anything which would identify the other party to call.
Am I missing anything here.
I know there are plenty of other WebRTC conference solutions out there on the web for demo purposes, but they all are so much more complex. I am looking for a simple 1:1 demo with source which will allow be to embrace the concept.
Look at the companion project apprtc or steps 7 and 8 of the WebRTC codelab
Having a "peer" requires an enormous amount of effort such as running a signaling server. The samples project only aims to demonstrate how to use APIs and does avoid the signaling topic by calling the API functions on another object in the same page.
I changed the demo code myself on: http://wx.qibu.net.cn/home/demo, using signalR for websocket. you can run it between different PC
The demo code should be separate and use stun and turn servers if necessary

SSL equivalent of givedescriptor() and takedescriptor()

I am converting an old tcp only server to use SSL (via IBM's GSkit), and one of the problems is getting the SSL handle into the spawned program. The original code passes the raw socket in via calls to the givedescriptor() and then uses takedescriptor() to get and then use the passed in socket.
Is there a GSKit/SSL equivalent of the give/take descripter methods?
givedescriptor() API documentation
UPDATE:
The issue is that the socket and the SSLHandle are created in one process, which initialized the SSL environment, and then need to be passed on to another process entirely - hence the need to give/take descriptor, as the socket / SSLHandle need to 'given' to the new process (it is actually an RPG program that is submitted and runs independently from the original program).
UPDATE 2:
Looks similar to this question, so I'll have a read of that as well.
From the other article (which doesn't have a code based answer, but a written solution)
"It looks like the session handles are just pointers to some storage
in heap. Due to the design of Single Level Store, you could copy them
via shared memory (memmap, shmget/shmat, ...). You just have to ensure
that the process that opened the GSK environment doesn't die or the
activation group will get cleaned up and those pointers will become
invalid. You also will probably need to put a mutex or some other
locking primitive around them if you're going to have multiple threads
accessing the shared data structure."
UPDATE 3:
This is the example I am using to share the memory between processes - Example: Using semaphore set and shared memory functions, still not exactly solved the issue yet though.
UPDATE 4:
I thought I'd add more details of why I need to ask the question. I am changing a non-blocking TCP server that is used as a connection point to an IBM i. It has the 'standard' mechanism for handling connections as they come it, creating threads and negotiating the connections in these threads. The threads then create independent process (via sbmjob). In the vanilla TCP version we can then give the running job the handle of the socket via the give/takedescriptor function, and will merrily write to and from the socket.
So I need an equivalent way of getting the independently running program to be able to write to SSL.
It maybe that this is not possible with the current mechanism.
There is no such thing as an 'SSL handle' known to the operating system and inheritable by child processes or transferable to other processes. The 'SSL handle' will inevitably be a pointer into some opaque data structure in the originating process, as SSL is an application layer protocol, and therefore implemented in the process, not in the kernel. So you can't 'give' an 'SSL handle' to another process and expect it to work.
EDIT
The answers here don't really answer the underlying question, which how I should do this, so although the bounty has been awarded, I can't accept the only answer.
The answer is that you can't do it.
It maybe that this is not possible with the current mechanism.
Correct. As you've foreseen this possiblity in your question, it is difficult to understand why you can't accept it in an answer.
In principle your idea is not impossible! If you believe that is possible try to find the answer!
If all answerer from the SO will say that is impossible it is not all time the true!
For example: 15 years ago I had tried to find the answer how can I write an Java-applet which can write and read images on a server.
Everybody had said to me that is impossible, but I did not believed it. I
tried to find my answer again and again. And I had found the answer: I
disassembled one online apllet from one specialist and in the source
code I find my answer: using PHP server we can do it. I asked the
owner from this applet about details of communication between
Java-applet and PHP server and he has helped me.
You have to find your specialist. That is the first rule to find the correct answer. May be on the IBM forum you will find someone.
The second rule is to read a lot of books from specialist about this. Not only one book. May be three of them or more.
I would recommend you also to read How do I ask a good question?, because in your question you do not have any computer language. And I think we have on SO someone specialist which could give you the correct answer.
The first rule on SO for finding of correct specialist is to set the correct tags. Without correct tags only few people see your question and it is only question of luck that somebody from them is the correct specialist for you.
Be optimistic and try to believe in you! Good luck and success!

Need to track unwanted file downloads

I'm looking to track how many people on the web have made my software program file available for download without my permission.
I've thought of searching for my product name and file size to catch possible thieves.
Do you think a web search API is the best way forward?
EDIT: I plan to use the detection data for survey purposes.
There are web analytics companies which could probably help you more than a roll-your-own solution. Consider the companies that big music and film vendors use, or check with the Business Software Alliance.
Ultimately, you are chasing your tail if you are looking to thwart piracy with the results of this kind of activity. However, if you are steadfast that you must try to understand what is going on, you need professional (web analytic) help. There are so many variations out there that you need someone experienced in tracking this kind of information, since you could easily get a false sense of security, or an inflated sense of activity.
No. This ultimately doesn't help you. What are you going to do? Send them emails tellings them to buy your software? Sounds like a spam filter will get it.
I would suggest in prevention rather than detection. A registration or activation process is pretty popular and reasonably successful, though if you have an amazing app it won't stop the really bad people from hacking it, however it will make it much more difficult.

Anyone tried submitting hs_err files to Sun?

I run a lot of java code on my servers, and occasionally I get a JVM crash, accompanied by a crash dump hs_err_pid file.
Lately I've decided to try to be a better netizen, so I examined the latest crash log, made sure it was indeed the latest JVM, and that the crash was not caused by an external library, and then I tried submitting the file to Sun's bug database.
However, it seems that the entire submitting process is geared towards preventing you from submitting bug reports, making sure you check the box to verify you understand that THIS IS NOT A PLACE TO RECEIVE SUPPORT, and forcing you to fill all this information that they could actually get from the crash file, and some more completely irrelevant information like my company name and Sun account ID.
So my question is twofold:
Is there some backdoor through which I can just say, "look, here's a crash log, do what you like with it"?
Should I even bother? It seems that Sun is hinting that they have enough bug reports as it is, and they don't really need people sending them more crash log files.
What should I do?
EDIT: In case I wasn't clear enough, I'm just trying to help Sun and the community. I don't expect any fixes, explanations or support.
On the other hand, I don't care enough about these crashes to put any effort into reproducing them or investigating them at all.
I do, but only with the understanding (hope?) that this is only for the greater good. I have never received a response or follow up.
However, it seems that the entire
submitting process is geared towards
preventing you from submitting bug
reports, making sure you check the box
to verify you understand that THIS IS
NOT A PLACE TO RECEIVE SUPPORT, and
forcing you to fill all this
information that they could actually
get from the crash file, and some more
completely irrelevant information like
my company name and Sun account ID.
My read is that it is geared toward 'setting expectations'. I'm sure there are, despite the process you complain about, zillions of folks who submit a report and then expect a person email from James Gosling himself in under two hours with a patch or workaround.
The contact info stuff is probably for a hypothetical Sun engineer that actually wants to contact you about the report with other questions.
Don't forget that Sun has a paid support programs, and that this crash report system is not where Sun customers are supposed to get support.
So, to directly answer your questions:
Use the front door. Why wouldn't you?
Yes, you should bother. Just don't expect any feedback.

Boost Asio and Web Sockets?

Does anyone know of any attempt to implement the Web Sockets API using Boost asio?
I realize this is an old thread, but wanted to update to help those looking for an answer: WebSocket++ fits the bill perfectly. Wt is an entire framework and may be more than many people want.
Wt implemented WebSockets on top of boost::asio.
Beast is another project, demonstrated at CppCon 2016 and used in rippled, an open source server application that implements a decentralized cryptocurrency system.
Also see this related question.
The closest example I know of anyone doing anything remotely like what you're asking is the Mongoose project. There is an increasing amount of discussion on the Mongoose mailing list about persistent connections for HTTP - but that's obviously not exactly Web Sockets. I would hope that someone would be able to add Web Sockets to it, too, eventually.