WebSocket4Net issue with multiple frames - websocket

I have a WebSocket Server that I can hit from a browser and get valid messages that parse JSON correctly. These messages are large, about 9K, and when looking at Google Chome Developer Tools I can see that its coming in multiple frames.
Now, I've been trying to hit the same service from a console application using WebSocket4Net. The smaller messages come across fine, but my larger messages are getting messed up. Basically, at the point where the Chrome Developer Tools are showing me where the initial frame ends, I'm getting the start of the next actual message, not the continuation frame.
I'm seeing some funny characters when looking at the HEX, at the point of the message truncation...seeing (HEX) 80 7e 06 15 .... or something close, but it always begins with '80 7e'.
I've increased the ReceiveBufferSize to 12,000, but that doesn't seem to help.
Anybody else ever see this?
Thanks.

Finally I was able to get some help on the CodePlex site. If you are having any issues like I was, check this posting out (https://websocket4net.codeplex.com/workitem/35).
Have a great day!

Related

I'm looking for help integrating Paypal IPN's with Marklogic

I'm using ngrok to tunnel to my localhost. The IPN simulator runs smoothly, as does Postman. But once I run through the whole process (make a transaction, wait for IPN), I'm getting the following error: 400 XDMP-REQUTF8SEQ: Invalid UTF-8 escape sequence -- requests are not UTF-8 encoded.
I put a xdmp:log at the entry point of the app and nothing was logged, so I believe the error occurs when the request hits the server. Is there a way to handle this at the server level? Has anyone had success integrating IPN's with ML?
Any help would be much appreciated! Thanks!
I think I found the answer:) In the IPN docs it says: When testing using the IPN Simulator, the character encoding will always be UTF-8. So if they're telling me that the messages will always be UTF-8 encoded when using the simulator, will the real messages be any different? Turns out that they just might be!
In the profile section of the PP account, click on "My Selling Tools" and scroll down to the bottom of the page. There should be a link that says "Paypal button language encoding". From there, click "More options" and you'll see what your options are. Mine was set up as "windows-1252". I guess that's what it is by default. Hope this helps someone else!

Chromecast sample sender application CastHelloText-chrome ends with error when trying to get session

I have problem with launching Google-Cast application similar to sample CastHelloText-chrome. I slightly modified example code for my specific purposes. The goal for creating this application is to send and show image data directly in Chromecast device.
Particularly the difference between official sample and my code is in message format and its content, sent by sender application. Sender application took png image coded by base64 and send through message bus with custom namespace. Receiver application get this message and use this as data source for html object <img>.
Error appears when I do this steps:
Reload sender page, checking console if any device found.
Send the form by just pushing enter on input box (text is ignored).
Now a popup from Chromecast extension shows. Next there are two scenarios:
3a) I confirm casting to device by choosing one from the list, then I get this error message in console:
onError: {"code":"channel_error","description":"Error: Timeout","details":null}
3b) I just click somewhere else, I get this error:
onError: {"code":"cancel","description":"User closed popup menu","details":null}
Both of errors are caused by calling function chrome.cast.requestSession in chromehellotext.html at line 161, but what's really wrong I don't know.
When I step sender script I realize that function sessionListener is never called. I know that something go wrong when code try to call chrome.cast.requestSession, where described error raises. So I need help if I missed about right way to use Google-Cast API or If this problem has something to do with networking issues.
Receiver application is registered on Google Cast SDK Developer Console and I'm testing on registered device with some serial number. I'm using Google Chrome in version 42.0.2300.2 canary (64-bit) and Chrome version 40.0.2214.111 (current stable I suppose). For testing I also tried to turn off Windows Firewall entirely but with no luck.
Edit:
There were some syntactic errors that caused error message described above.
It seems like you are trying to use the data/control channel to send an image; please don't do that; that channel is not meant to be used for large data communications; in fact it cannot send anything which approaches or exceeds 64k. If your goal is to send images from your local machine, you would need to run a local web server on your local machine and serve images through the web server.
For and easiest tutorial you can have a look to this tutorial.
It is well explained in this tutorial.
Chromecast Sender application
There is no need to maintain session by yourself.
just add button and enjoy casting
mCastManager.addMediaRouterButton(mediaRoutebtn);
I found a source of my problem. There was something wrong in receiver code - syntactic and runtime errors, so I must admit that my code wasn't functional. Now its working in terms of launching application and getting session.
Unfortunate thing is that the error message generated by Chromecast extension didn't match the actual error - at least it was a bit confusing when I didn't know what's really happening on receiver side without ability to debug the code.

YouTube iframe API official example gives errors

As of 2013-04-16 WEST, the official getting started example of the YouTube iframe API results in error messages when run in Chrome 25 on WinXP/SP3:
I am accessing the example hosted on a web server, i.e. not via the local file system.
Am I doing something wrong? Is the example / the API broken? Can you reproduce the issue?
This error message has been around for quite a while -- as this Google Group post explains, it's due to an unresolved (4-year unresolved!) bug in WebKit:
https://groups.google.com/forum/?fromgroups=#!topic/youtube-api-gdata/VKGl4ahBGyk
It shouldn't affect anything -- it certainly hasn't for our projects, and in visiting the demo URL you posted, it looks like it isn't affecting the API functionality there (i.e. in that demo, the video still stops after 6 seconds per what the code states). There was an SO question a while back that thought it might be affecting analytics:
youtube "Unable to post message to..." causing video analytics to not be tracked
But it was never confirmed as being relevant.
It will be interesting to see if Chrome's move to the new Blink fork of WebKit leads to the bug itself being resolved.

Chrome GET request cancels and restarts continously

I am trying to play an mp4 video on my website using window.location = path-to-file/file-name.mp4 through Chrome. Although the video plays, Chrome Developer Tools Network tab shows that that the request continuously gets cancelled and resent:
.
I have left the Developer Tools window open and it has shown that more than 5000 requests have been made and over 600 MB transferred :
It's beyond me why this is happening. I have tried looking at the the request and response headers for the first 4 requests to see if I could spot something obvious (I am by no means an expert):
and the only thing I can see is that the RANGE and CONTENT-RANGE in the request and response headers, respectively, seems to be changing. I also noticed that the very first response has TRANSFER-ENCODING set to CHUNKED.
I tried researching these terms but was not able to come to any conclusions (except the one that I still have a lot to learn, haha). If anyone could please provide any help or point me in the right direction I would be most appreciative :)
Thanks for your help!
EDIT : I would like to add that I am not explicitly creating a GET request with XMLHttpRequest, just using window.location to play the video in a new window.

Chrome XmlHttpRequest Hanging

When I make a XmlHttpRequest (via jQuery's $.ajax) to a particular URL, my Chrome consistently hangs every time with a status on the request of 'Pending'.
After that Chrome must be closed ie. forcibly from Task Manager, and it exhibits general signs of mayhem such as the Cookies and Scripts tabs being empty when they were full of normal looking data immediately prior.
This is odd because (a) my coworkers, running a seemingly identical everything, have no such problems; (b) I have been using Chrome to run this code (our company's JavaScript app) for many months and this just started happening for no apparent reason.
I checked out the Apache logs, they appear to be processing the request normally and to completion, but Chrome never sees the reply, apparently.
A couple of other clarifications: prior to the failure, the same Chrome and Apache return a truckload of JS and image files normally, eg., things seem to be fine right up until they aren't. The request is not particularly large (a few hundred bytes in and out) or complex in any obvious way.
If anybody can give me some hints of where to look, I'd be grateful!
I'm experiencing similar behavior with slightly different symptoms. My ajax requests work fine, every second request up to 6 requests, then they all start failing (same url as when working, same payload, etc), but in my case they're not even hitting the server, just stuck in "Pending" in Inspector.
I dont have an answer for you, but to help debug, have you tried chromes net-internals?
Point your browser at:
chrome://net-internals/#sockets
and/or
chrome://net-internals/#events
I see my requests in #sockets go into "active", but never come back, and in #events I can see that the request stalls after the HOST_RESOLVER_IMPL_REQUEST stage.
I'm thinking it could be a resource issue caused by not properly ending the request, but thats just pure speculation.

Resources