I'm working with Qt-creator on Ubuntu. I have to send a pdf file to my server on my network using TCP Connection. I'm making the client side application.
I have googled a lot but couldn't find any pointer to the solution.
Any help would be highly appreciated.
Related
Usually I make use of AutoITscript to upload a file in the Windows dialog box. This is useful while testing on Local Machines on any browsers. But,since I have now moved to use BrowserStack to tun my tests on cloud, I am finding it difficult to run the AutoIT script on the remote browser. Any help in this regards is much appreciated.
Thanks!
Note :I cannot directly enter the file path in the web UI as its disabled and the only way is to open the Windows dialog and browse to the actual path,which I used to do using the AutoIT script.
I'm using qtwebsocket from https://github.com/antlafarge/QtWebsocket on QT Creator 5.0, Linux 64bit. I'm trying connect to echo test:
wsSocket->connectToHost( "echo.websocket.org", 80 );
But I immediately get disconnected status. I tried also with ws:// and http:// prefix but same error. Any idea? I even don't know how to report a bug on this gitorious.
It is important to me to don't use webkit, I need pure TCP socket connection.
Regards
There is also a Qt websockets add-on module located at https://qt.gitorious.org/qt/qtwebsockets.
It has been tested on several platforms, and successfully succeeds with the AutoBahn Testsuite.
Just quickly looking at the example located:
https://github.com/antlafarge/QtWebsocket/tree/master/Example
I don't know the state of the project too well, but it looks like there is still a to-do list on what it can do; one item I noticed, it says WSS is not yet supported.
Try running both sides of the Client and Server in the included example, and see if you can get a connection in that context before trying the echo.websocket.org server.
Hope that helps.
I'm trying to run the sample application that comes with xsp package on my Raspberry Pi (running arch linux), but unfortunately apparently the connection is closed before any http response is sent to the browser. I get on chrome the "NO DATA RECEIVED" message.
xsp however just outputs "Application_Start" and nothing else happens (other than chrome saying no data received)
Here's what I do:
$ xsp2
xsp2
Listening on address: 0.0.0.0
Root directory: /srv/http/test
Listening on port: 8080 (non-secure)
Hit Return to stop the server.
Application_Start
And Chrome's output:
No data received
Unable to load the webpage because the server sent no data.
Here are some suggestions:
Reload this webpage later.
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.
Of course on my Linux PC box it runs fine.
If anyone got any insights other than I'm trying to take too much out of my $35 board, let me know?
For the information of whoever visits this page:
Raspberry pi does not have an official mono implementation on hard float operations. That's why a lot of mono stuff will NOT work, including xsp =]
A gentleman posted on raspberry pi forums an experimental version of mono with an implementation of hard-float which form me worked fine. The post is here.
For Arch Linux users, I've come up with a package build so that you can create an arch linux package, and posted on the same thread. Exactly here. Instructions on how to build it are also there.
Running xsp will work after this, at least for me it did. I also did use .NET to handle GPIO and all worked beautifully.
Hopefully this helps! =]
With a bit of reflection and a socket server it's not that hard to create your own asp.net host (well I got it to support <% %> syntax with code behind and user controls (don't use/want the built in controls since they are less portable and not as transparent as I'd like)). Works fine on my arch berry.
Or you could try the self hosting from MS http://www.asp.net/web-api/overview/hosting-aspnet-web-api/self-host-a-web-api, not sure if it works with mono though (but do let us know if it does ;)).
If you are using the Raspbian distribution the Mono packages are having issues compiling and the ones that are out there have issues running .Net applications because of the specific processor features Raspbian takes advantage of. You have to use the older Debian that does not use the Hard Float armhf.
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=66&t=11634&start=75
UPDATE + SOLUTION ===============================
Sorry to be posting the solution here instead of in a comment, but something about my work's filtering doesn't allow the comment functionality to work for me.
I ended up using the -b 0.0.0.0 property in jboss to bind to all addresses, so I could try accessing machine A's server with machine B as the client, and vice-versa. I found that it always failed to load when running on machine B, whether or not I was connecting from A or B.
I started wireshark on a windows machine on the same network, and observed the TCP connection that was loading the webpage. I saw that the request for the .swf in the cases where it failed had a content length of 2 million or so, and when I right clicked the wireshark logs and selected "view conversation" or something like that, the size of the total conversation to get the .swf file was only 130,000. Looking at about:cache, that was about equal to what it ended up caching before saying "Done" on the page.
I ended up finding that there is a bug with the useSendFile property. (http://community.jboss.org/thread/148651?tstart=0). This causes it to only send part of the file if you are running low on kernel memory. Using useSendFile="false" in our server.xml has seemed to resolve the problem.
==================================================
Original Problem
I have a JBoss (5.1.0.GA) application server. I am using GraniteDS to connect between the application server and the client. The client side is flash-based.
Granite DS requires the use of the APR library (apache native library), so I am loading it. I see in the JBoss logs that it says it loaded the apache native library just fine (version 1.18, though I've also tried 1.20).
The issue is that when I have it so the APR library loads successfully, then the Flash side of the application does not usually load. I'll have to hit refresh a bunch of times and eventually it will usually load, but normally I'll see either a black webpage that says "Done" or the loading progress bar never move. Only by repeatedly hitting refresh will the page load. It will load eventually by hitting refresh enough, but it is not consistent and this obviously will not work for our clients who have to clear their browser's cache every time.
This problem only exists on Solaris, our application works fine on Windows. We've tried multiple patch-levels of solaris, and have verified with the "ldd" command that the library that needs to be loaded has all its dependencies there.
We've verified it isn't our swf file's size by testing:
1) Our regular SWF (1660 kb).
2) A random large-ish SWF (950 kb).
3) A small SWF with one label component that says "Test" (277 kb).
All 3 were unable to load when JBoss was also loading the native library, and loaded just fine without it. We need the native library to load successfully for Granite to connect between the client and server though, so not loading it isn't an option (unless there's some way to use the NIO connector with JBoss, but it appears unsupported).... if there is a way to use the NIO connector then we shouldn't need the APR library.
Has anybody run into this before? Anybody have any ideas or recommendations?
Have you tried the jboss native libraries for Solaris ?
http://www.jboss.org/jbossweb/downloads/jboss-native-2-0-9.html
I need to make a labview VI that will display a jpeg image from a URL. (the url is generated based on some data)
I've found a way to display an image from the hard drive (Read JPEG File), so what I probably need is just a way to download it to a temporary file.
All I've found are some low level TCP client VI's. Is there an easier way? If there isn't I can just open a browser window, but I'd rather not.
Have a look at this LAVA post, titled Downloading an image from a Web server using Datasocket.
The only disadvantage is that it is not cross-platform, it will only work on Windows, on Linux I have seen this code killing LabVIEW.
The OpenG Internet Connectivity toolkit has code that is cross-platform.
Ton