i hava an idea, create a streaming server and client with VLC
- Server streaming file_1 to client
- Client play file_1, after finished play file_1, client request to Server for file_2, file_3 . . .
So . . . how to know client finished playing a file to send next request play file_2, file_3?
Please help me, thanks so much
Related
Dancer2 is a PSGI web application framework, we can use the "plackup" tool (provided by Plack) for launching the application:
plackup -p 5000 bin/app.psgi
The web application created using Dancer2 script can be viewed on localhost and port 5000.
http://localhost:5000
We can then write a get request as follows:
get '/hello/:name' => sub {
return "Hi there " . route_parameters->get('name');
};
For GET requests to "/hello/...", the code block provided above gets executed.
If the application is down, for GET requests to "/hello/...", the following error is shown:
curl: (7) Failed connect to localhost:5000; Connection refused
How do we integrate Dancer2::Core::HTTP helpers for rendering HTTP status codes for Dancer2 so that the following status code is shown when the app is down? Similarly, there are other error handlers too, how to integrate them as well?
status_500 status_error, status_internal_server_error
I have created custom rest api endpoint in magento for downloading pdf file.
When testing it locally: From separate react JS project I am sending request to that endpoint and file is downloaded successfuly. http/1.1 protocol is used (checked in google chrome dev tools, network tab).
After deployment to staging servers, when I try to make request between staging servers from reactJS project to magento2 project, then upon sending request it takes 30-40 seconds without getting any response and then error is shown in console. There is not anything in the error logs. http2 protocol is used (not sure if that can be a reason for issue).
Failed to fetch - net::ERR_HTTP2_PROTOCOL_ERROR 200
Here is the piece of php code for downloading pdf file:
...
$filename = $outputFileName . time() . '.' . $extension;
$directoryTmpWrite = $this->filesystem->getDirectoryWrite(DirectoryList::TMP);
$directoryTmpWrite->writeFile($filename, $fileContent);
return $this->fileFactory->create(
$outputFileName . '.' . $extension,
[
'type' => 'filename',
'value' => $filename,
'rm' => true,
],
DirectoryList::TMP, //basedir
'application/octet-stream',
''
);
How I resolved my issue?
I had to turn on output buffering in php in magento, to ensure that no output has been sent from a script and instead of that output has been store to a buffer and then sent all together from a script when script execution is finished.
So ob_start() fixed my issue. Right before return statement.
I try to push stream to facebook from nginx server withi this summary:
- install nginx (with rtmp module) on debian
- nginx.conf
rtmp {
server{
listen 9999;
chunk_size 4096;
application live {
live on;
record off;
push rtmp://live-api.facebook.com:80/rtmp/key;
}
}
}
and error received:
2018/01/23 09:31:10 [error] 6826#0: connect() to [2a03:2880:f002:12a:face:b00c:0:1411]:80 failed (101: Network is unreachable)
2018/01/23 09:31:10 [error] 6826#0: *5 relay: push reconnect failed name='online' app='' playpath='' url='live-api.facebook.com:80/rtmp/key', client: IP, server: 0.0.0.0:9999
Is there something wrong ?
I'm still in searching to resolve this
Thank in advance
replace 'key' from your push URL with your private key found in https://www.facebook.com/live/create
Sometime in peak hour, the facebook RTMP server stop accepting new request. Happened to me so many times while simulcast Youtube/FB Live / Twitch on Nginx RTMP Module.
Another solution is, fire up free tier AWS EC2 AMI Linux, install NGINX with RTMP Module and pushing from there.
I need your help/advices on my very short script I wrote in Perl in order to send SMS via SMPP protocol.
I got a SMS gateway which is perfectly working (sending SMS via HTML request or via web interface works), let's say this gateway has IP 192.168.1.15.
Its SMPP service is listening to TCP 2775 (I can successfully telnet to 2775, so I guess SMPP service is working on my SMS gateway)
my $smpp = Net::SMPP->new_transmitter(192.168.1.15,
port=>2775,
system_id =>"administrator",
password =>"passwdexample") or die;
$resp_pdu = $smpp->submit_sm(destination_addr => '+400123456789',
short_message => 'test message') or die;
die "Response indicated error: " . $Resp_PDU->explain_status() if $resp_pdu->status;
When I run the script, here the error I got :
Response indicated error: Incorrect BIND Status for given command (ESME_RINVBNDS TS=0x00000004) at C:\temp\smpptest.pl line .
Unfortunately, I haven't find so much help on internet, but according to this link : SMPP Errors Codes It says :
You must bind first before any other request is handled.
However, my bind is done with new_transmitter, and I don't get any errors at this point, so I don't understand how it cannot bind the TCP session (my credentials are corrects, I tried that in a telnet session).
That's the first time I use such a plugin, so maybe I'm missing something, and maybe someone has already met this error !
Many thanks for your help :-)
Try to quote the IP address:
Net::SMPP->new_transmitter("192.168.1.15", ...);
I'm Using Sphinx 2.0.5-release On both Server .
Both Server have same indexers.I have Searchd running on both server . But I would like
to fetch Data of Server 1 from Server 2.
I used this particular code :
$cl = new SphinxClient;
$cl->SetServer(remote_sphinx_server,9312); (remote_sphinx_server : IP address of 2nd
Server)
$cl->SetMatchMode(SPH_MATCH_EXTENDED);
$result = $cl->Query("","$indexer");
But I Don't get any response .
Im getting error : connection to "Server 2 IP:9312" failed (errno=113, msg=No route to
host)
If i Use below code :
$cl = new SphinxClient;
$cl->SetMatchMode(SPH_MATCH_EXTENDED);
$result = $cl->Query("","$indexer");
I get proper response. As the data is coming from local Sphinx .
What can be the problem fetching data from remote Server ? Any Help is very much
appreciated .
Thank you
you may have multiple network interfaces on server 2 and you are using one the IPs that is not reachable by server 1
check if firewall allows communication on port 9312
check if searchd does run on server 2. Also, by default, searchd opens the port on all available interfaces, unless specified. Check searchd.log if reports any error about opening the port(s).