Qt IPC - Named Pipes - qt

I'm developing a qt browser plugin and want to implement named pipes in it. I tried the basic fortune cookie example provided with the QLocalSocket and QLocalServer in an exe and it works fine. But when i try to implement a similar thing in the browser plugin, making a page where the plugin is present listen to a name (like a server) and another tab/window which tries to connect to this. But this doesn't seem to work. When i do a client->errorString() it prints out "Unknown Error".
Any help on what I'm doing wrong?
Thanks a ton in advance

Put debug output to check the following things:
Has your client asked for a connection?
Has the server received a request to setup a connection?
Has each entity created it's QLocalSocket instance?
What does QLocalSocket::state() say on both entities?
Possible causes:
Have both of your code paths received cpu-time (seperate threads in the same process?)?
Is there a deadlock?

Related

How do I disable Expect100Continue if I use BizTalk to communicate with a webservice?

An interface has as a requirement that we do not include an expect-100. (The documentation is assuming I will be using c# or php code to talk and has the code to not send the expect-100)
I quickly googled around a bit and found many topics on how to disable this when not using BizTalk and found multiple posts that would make me believe that BizTalk sends an expect-100 by default as well. (BizTalk Data Services: Extended to bring management functions through IUpdatable and Adding Custom HTTP Headers to messages send via HTTP Adapter.). I have had trouble in finding someone trying to disable it.
Since I have found the C# code to disable it, would a solution be to create a custom pipeline component that disables this?
This is not something I would worry about. I don't recall ever seeing Expect: 100- continue in any trace to or from BizTalk using WCF.
I will say that it is very strange that they would have a dependency on not seeing this. Either way, if WCF is sending it, you should be able to remove it with a Behavior.
You'll have to set this all up to even see if it's a problem. Here's where I say just try it and see what happens.

Best way for making a singleton socket for web application in .net?

I am having a lot of problems with the behaivour of the socket (not closing or opening correctly) used in a webapp to communicate with another program running on a server. The problems I hava found is that the socket either ends up being opened or closed various times during the same request or it does not ends even when I kill the active session.
Currently I save the socket in a Session Variable and I check whenever it should be created or if the value of the variable should be referenced, although I am still having a lot of problems.
Have you faced something similar and would you share some of your experience with me?
Also at first I tried to make it Static although I had even more problems with it.
Thank you.
You put your active open sockets in cache or application object in dictionary or whatever suits you provided by asp.net. Before opening new port you check if it is already open by looking in dictionary stored in application or cache. Remove the entry from dictionary when conection is lost.

Channel.Ping.Failed error Detected duplicate HTTP-based FlexSessions What's the root cause?

Hi
I've downloaded the Cairngorm3 Simple Sample Application from here.
There's a few steps.
a) Download the server-side zip. It contains a PDF instructing how to start a HSQLDB database and get a Tomcat instance up an running (I used catalina.sh start).
b) Check out the source with Subversion, and load it up into Flashbuilder 4. (You need Flex 3.4 SDK)
When I run the app (an Outlook like app written in Flex), I have issues at the point I try and save a contact. I'm assuming it's on a remoteobject call.
But it I get this:
Send failed
faultCode:Client.Error.MessageSend faultString:'Send failed' faultDetail:'Channel.Ping.Failed error Detected duplicate HTTP-based FlexSessions, generally due to the remote host disabling session cookies. Session cookies must be enabled to manage the client connection correctly. url: 'http://localhost:8400/messagebroker/amf;jsessionid=5765DDDB6E2D54BD03D3E636B0E8C03E'''
I'm wondering if this is something you need to tweak in services-config.xml?
Located in flex-frameworks/tomcat/webapps/ROOT/WEB-INF/flex folder (flex-frameworks comes from the server-side zip download:
Anyone got any ideas?
This is Christophe Coenraets baby.
I also subsequently found a blog post by Alexander Glosband, but couldn't ascertain from it, what you need to do as a work around. i.e. Is this something that is configurable?
The way to reproduce the error consistently is to try and activate the web camera from the app. Then instead of clicking accept, reload the screen. Then when you try and take a photo after subsequently granting access to camera, you get the duplicate session error.
I think there is an issue with the code pertaining to the Camera, that's not cleaning up after itself correctly, the session is probably not being tidied up correctly.
You are right, problem comes from services-config.xml. Change your url from
http://localhost:8400/messagebroker/amf
to
/messagebroker/amf
I found solution from here send failed error
"Compiler EMBEDS channels, endpoints and destinations into SWF" video tells.

Http Error in J2ME app

I am trying to make an Http connection in a J2ME application.
Problem is that it is running fine in the emulator; but in a mobile, it is showing IO exception- Error in Http Operation.
Can anyone tell me what prompts this kind of error.
Thanks in adv.
All sorts of possible causes:
Incorrect network settings
No mobile reception
No credit on PAYG
URL inaccessible through mobile operator's walled garden
Which API call in particular generates the exception?
Dont forget the midlet permissions in the Jad file too. They too may cause an error.
Thanks for your answers.
Seems like it was a very stupid mistake on my part...I had'nt written the Connection code within a thread.
Small change solved the problem. Just rewrote the Connection part within run() of thread.

Retrieving the PC Name of a Client? (Windows Auth)

I have an ASP.net Application that runs on the internal network (well, actually it's running on Sharepoint 2007).
I just wonder:
Can I somehow retrieve the name of the PC the Client is using? I would have access to Active Directory if that helps. The thing is, people use multiple PCs. So, I cannot use any manual/static mapping.
If possible, I do not want to use any client-side (read: JavaScript) code, but if it cannot be done server-side, JavaScript would be OK as well. ActiveX is absolutely out of question.
System.Web.HttpRequest.UserHostname as suggested in this answer just returns the IP :-(
But I just found this:
System.Net.Dns.GetHostEntry(Page.Request.UserHostAddress).HostName
That only works if there is actually a DNS Server to resolve the name, which is the case for my network.
Does System.Web.HttpRequest.UserHostname provide what you're looking for?

Resources