Error connecting to Icecast - icecast

I have setup Icecast server on Ubuntu 14.04. I am using ezstream source client to send to the Icecast server. Everything seems to work for a while. After I load many streams, Icecast seems to hang and does not accept the new request.
Log for Icecast:
[2014-08-20 05:07:24] EROR connection/_handle_connection Wrong request type from client
[2014-08-20 05:07:24] INFO source/source_main listener count on /streaming/76cafede98c3aa484821fe707f3a919f now 0
Occasionally, log reports this error as well:
WARN source/get_next_buffer Disconnecting source due to socket timeout

It seems that you are overloading your network?
WARN source/get_next_buffer Disconnecting source due to socket timeout
The above error usually happens when the source client fails to send data fast enough to the Icecast server.

Related

QtNetworkAccessManager doesn't work after network restart and issues QNetworkReply:UnknownNetworkError

I am a beginner in QT. I have a custom application which sends and receives information from my http server. When the network services are restarted, the Qt application doesn't connect with the server and issues network error as below. Also, after restart the issue gets resolved.
Here is my error log:
Network error QNetworkReply::UnknownNetworkError received
requestFinished, code: 500 url: "xxxx/xxxx/xxxx" (unknown:0) -
QIODevice::read (QDisabledNetworkReply): device not open
I have searched in forums but I couldn't get a solution to the same.

Keep gRPC client in listen mode for message from server

I have a gRPC server written in C++ which is running on a server say Gabroo
Gabroo:~/grpc/examples/cpp/stream_server$ ./stream_server
DB parsed, loaded 1 features.
Server listening on 0.0.0.0:50051
The client is running on same server and exits after receiving the message.
Gabroo:~/grpc/examples/cpp/stream_server$ ./stream_client
DB parsed, loaded 1 features.
-------------- GetFeature --------------
Found feature called PatriotsPath,Mendham,NJ07945,USA at 40.7838, -74.6144
Found no feature at 0, 0
Now if the server wants to send a message to client but client is not listening for any message is there some configuration needed so that client is in listen mode continuously for stream messages from server.
If it is not available inbuilt would infinite loop and checking for message every 1 secs be a good approach. I personally don't like this approach.
Regards !!!
This can be solved using RPCs of different arity. Most generally, you could define a bi directional stream between client and server. That way, if a stream is open, the client will be listening, ready to receive messages from the server.
If you use case is more specific, and you only need on client RPC per stream, then you could consider using Server streaming RPC.

RakNet tutorial dropping clients

sorry for the noobish question but I can't find any resources online clearly stating whether this should work or not, and all tutorials / sample code always use localhost ^^ Soooo...
I'm trying to setup a simple server / client using RakNet. I'm literally just following the first tutorial (http://www.jenkinssoftware.com/raknet/manual/tutorial.html), just trying to get the client to connect to the server and keep the connection alive for a bit.
It all works great as long as I use 127.0.0.1 or 192.168.0.XXX, I can start the server, then the client, the server detects the connection request and sends the reply to the client, the client receives the reply and prints out "connection accepted" and such, and I can exchange messages between the client and the server.
However if I try using my actual IP, the server does not seem to detect the connection request (if you look at the tutorial code, it doesn't print "incoming connection"), but the client still receives a reply from somewhere ("Our connection request has been accepted").
After this initial semi-successful connection, no more packets will be received by either server or client, and the client will inevitably get disconnected after a few seconds (I assume time out?).
Port is open on the router, and the app runs fine as long as I keep it on localhost.
So my question is: is it even possible to run a server and client on the same machine / IP which is sitting behind a router?
The RakNet documentation part about NAT punchthrough and UDP forwarding does mention no more than one client and server being able to run on the same machine, but I was under the impression that one server / one client would not be an issue?
Thanks in advance to anybody who can shed some light on this!!
Forgot to mention my firewall is disabled !

MAMP - WSO2 DSS - Error establishing data source connection: Communications link failure The last packet sent successfully to the server

I'm running MAMP and WSO2 Carbon data service at the same time. What I'm trying to do is adding a new data source by connecting to mysql server. I have added the com.mysql.jdbc.Driver to lib folder.
Full error which I'm getting when trying to test the connection
Error establishing data source connection: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
In my case simply putting useSSL=false on end of connection string did the magic
jdbc:mysql://localhost:3306/USERS?useSSL=false
This seems to be a problem with mysql server configuration. Please have a look at following threads.
Solving a "communications link failure" with JDBC and MySQL
Why I get this error 'Communications link failure The last packet sent...' when connecting to MySQL with Java (Netbeans)?
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:Communications link failure
I tried this and it's working by my side:
jdbc:mysql://localhost:3306/wso2_test?useUnicode=true&characterEncoding=UTF-8

How to handle SSL connection premature closure

I am writing a proxy server that proxies SSL connections, and it is all working perfectly fine for normal traffic. However when there is a large file transfer (Anything over 20KB) like an email attachment, then the connection is reset on the TCP level before the file is finished being written. I am using non-blocking IO, and am spawning a thread for each specific connection.
When a connection comes in I do the following:
Spawn a thread
Connect to the client (unencrypted) and read the connect request (all other requests are ignored)
Create a secure connection (SSL using openssl api) to the server
Tell the client that we contacted the server (unencrypted)
Create secure connection to client, and start proxying data between the two using a select loop to determine when reading and writing can occur
Once the underlying sockets are closed, or there is an error, the connection is closed, and thread is terminated.
Like I said, this works great for normal sized data (regular webpages, and other things) but fails as soon as a file is too large with either an error code (depending on the webapp being used) or a Error: Connection Interrupted.
I have no idea what is causing the connection to close, whether it's something TCP, HTTP, or SSL specific, and I can't find any information on it at all. In some browsers it will start to work if I put a sleep statement immediately after the SSL_write, but this seems to cause other issues in other browsers. The sleep doesn't have to be long, really just a delay. I currently have it set to 4ms per write, and 2ms per read, and this fixes it completely in older firefox, chrome with HTTP uploads, and opera.
Any leads would be appreciated, and let me know if you need any more information. Thanks in advanced!
-Sam
If the web-app thinks an uploaded file is too large what does it do? If it's entitled to just close the connection, that will cause an ECONN at the sender: 'connection reset'. Whatever it does, as you're writing a proxy, and assuming there are no bugs in your code that are causing this, your mission is to mirror whatever happens to your upstream connection back down the downstream connection. In this case the answer is to just do what you're doing: close the upstream and downstream sockets. If you got an incoming close_notify from the server, do an orderly SSL close to the client; if you got ECONN, just close the client socket directly, bypassing SSL.