SSDP discovery on Windows Store App not reliable
Hi,
I am having problem implementing SSDP discovery in windows 8 store program. Below is the code:
public async Task SearchForDevices()
var socket = new DatagramSocket();
socket.MessageReceived += async (sender, args) =>
Debug.WriteLine("Received data" + DateTime.Now);
DataReader reader = args.GetDataReader();
uint count = reader.UnconsumedBufferLength;
string data = reader.ReadString(count);
Debug.WriteLine(data);
var response = new Dictionary<string, string>();
foreach (
string x in
data.Split(new[] {"\r\n", "\n"}, StringSplitOptions.None))
if (x.Contains(":"))
string[] strings = x.Split(':');
response.Add(strings[0].ToLower(), x.Remove(0, strings[0].Length + 1));
Device device = await GetXml(response);
Debug.WriteLine("Device found");
if (DeviceFound != null)
DeviceFound(this, new DeviceFoundEventArgs(device));
await socket.BindEndpointAsync(null, "");
HostName hostName = new HostName("239.255.255.250");
socket.JoinMulticastGroup(hostName);
string message = "M-SEARCH * HTTP/1.1\r\n" +
"HOST: " + hostName.DisplayName + ":1900\r\n" +
"ST: upnp:rootdevice\r\n" +
"MAN: \"ssdp:discover\"\r\n" +
"MX: 3\r\n\r\n";
DateTime start = DateTime.Now;
TimeSpan interval = new TimeSpan(0, 0, 30);
Debug.WriteLine(start);
IOutputStream stream = await socket.GetOutputStreamAsync(hostName, "1900");
var writer = new DataWriter(stream) { UnicodeEncoding = UnicodeEncoding.Utf8 };
writer.WriteString(message);
await writer.StoreAsync();
await Task.Delay(1500);
This code is not reliable at all. About 50% times it can't find a connected device while other discover can find. But sometimes it works.
My network sniffer (SmartSniff) sometimes can't even capture its SSDP request even though I have made the call many times.
I don't think this is an async problem since it does work occasionally. Please help me. Thanks!
Hi Jeff,
I have an additional question to this thread.
I try to share code between WinRT and Windows Phone 8 using similar code.
Starting on Windows Phone 8 I ommited the following lines:
await socket.BindEndpointAsync(null,
socket.JoinMulticastGroup(hostName);
This worked fine on the Phone. MSDN mentions for BindEndpointAsync,
that GetOutputStreamAsync also leads to a binding.
I could receive answers. but when I tried to use this on WinRT/Windows Shop I did not receive anything. I had to put in the two lines of code from above.
This is not how it is supposed to be, right?
Stefan
Similar Messages
-
We are attempting to use Application Insights (v0.12.0-build17386) for our Windows Store App. When we use TelemetryClient.TrackException, no details appear in the azure portal. The Failed Method is "Could Not Parse" and the Call Stack
is empty. If we click on the "..." it gives more details but still no method name or call stack information to help us determine where the exception was thrown. Is this by design, not implemented, or did we miss something obvious? The
code is very simple:
public static void LogException(Exception exception)
TelemetryClient telemetryClient = new TelemetryClient();
telemetryClient.TrackException(exception);This is a known limitation of this version. It is in the backlog to fix. Note though that 0.13 is out already and fix should be included in the next version (0.14)
Anastasia -
Publish my windows store app, but not until I'm 18?
Hello,
I am about finished with my first Windows Store app :-) and I went to get a developer account so I can publish the app (I am even willing to let go of $50 for initially publishing a free app), and it said "You must be 18 years old to have a Windows
Store developer account." :-( It said this because I am 17, but I want to clarify here. Are you saying that everyone under 18 is completely locked out of app sharing? Since the Windows Store is the only means of distribution, it is surprisingly inaccessible.
I am not even submitting a paid app yet, so I don't even need to worry about direct bank deposits for getting paid. I'm a bit lucky because my birthday is only 6 months away, but what if there are 15 or 16 year-olds that want to release their app to the world?
I think you should have a type of youth account or something. For example, (if you are under 18 only) it would be free to create, and you can only publish free apps. This seems like the only truly fair way to make up for the monopolistic distribution, not
to mention help the entire Windows 8 app ecosystem.
I seriously don't know what problem there would be with people under 18 publishing their apps. I even work at my community college as a math tutor! Could the restriction be lowered to 16 years old?Listen, I love Windows 8 and the new app platform, but this requirement is ridiculous, and it needs to get fixed for the good of the platform. Already, only 33% of developers are even willing to develop Windows 8 apps, whereas there are some 16 and 17 year-olds
(like ME) that are shunned out of the process. This is unacceptable.
Alex, I understand your feelings on this, but this is absolutely the same on any other platform. It is also the same for any legal aspect of starting a business. When you start selling or distributing applications through the Windows store, or
via the App Store, or Play... you are exposing not only yourself, but the respective operators of those systems, to all sorts of liability and in order to clearly define rights and responsibilities, contracts are required. For example, you have to sign
a contract that in part attests to the fact that you understand and agree that you won't use your apps as a means of doing or promoting anything illegal. You also attest that you won't rampantly steal content that belongs to others, etc.
The problem is that any such contract you sign does not carry the weight of law; under the law, you cannot enter into a contract and have that contract be binding. Any 'promise' you make under such a contract is thus automatically void and the contract
provides no protection at all to the other party arising out of any action you could potentially take. Not only that, it exposes them to potential liability arising out of allowing a minor to participate in contractually obligated proceedings knowing
those proceedings are null and void.
You would not be able to open a bank account or obtain a credit card without the assistance of a parent or guardian. This is no different.
The easy answer, as has been suggested already, is to have your parent or guardian sign up for a developer account and sign any necessary contracts, and then develop away. -
Windows Store apps on Windows Server 2012 with XenApp?
We've got asked by a vendor whether our app will be able to support multiple simultaneous users, when installed on Windows Server 2012 and accessed via XenApp.
I suppose the real question here is whether or not Windows Store apps can be run in XenApp over Windows Server 2012 at all, and if so whether there are any special requirements on the apps to support multiple simultaneous instances execution.
The app itself takes each user through a log in procedure, during which all the dynamic user-specific data is retrieved from the back-end server; no such data is stored by the app locally.
Any advice will be greatly appreciated!
Thank you,
AlexHi,
To better help you, the Citrix support could be more helpful on your questions:
http://support.citrix.com/search?searchQuery=*&lang=en&sort=date_desc&prod=XenApp&pver=
The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
As I known, we always use Remoteapp feature to share app, but it is only worked for desktop app:
Publishing RemoteApps in Windows Server 2012
http://social.technet.microsoft.com/wiki/contents/articles/10817.publishing-remoteapps-in-windows-server-2012.aspx
About citrix product, I knew little about it.
Kate Li
TechNet Community Support -
Distributing multiple versions of an app within a single Windows Store app
The company I work for creates Point Of Sale (POS) software using Software As A Service (SAAS), so we host our clients' databases. We do not force all of our clients to all be on the same version of our software; i.e. some clients are on version 3,
others v4, others v5, etc. As you would expect, the database schema for each of these versions is different, so each of these clients also use a different version of our client-side app.
We are looking at making a Windows Store app that acts as a light-weight POS app that clients can use to sell their products. The problem is, we will require having multiple versions of our Windows Store app in production; the version of the app that
the client uses must correspond to their database version. We were initially hoping to have our Windows Store app detect which version of the app the client should be using, and then automatically update itself to the correct version, but
were told on this post that it violates the Windows Store certification criteria, so that's not an option.
It has been suggested that we put multiple apps into the Store; one for each version of our software. We really don't want to do this though, as when we upgrade a client's database from one version to the next it would require that they uninstall their current
app and install the newer versions app, causing them to lose all of their custom settings. We would like the updates to remain as transparent to the end users as possible; the store clerk shouldn't need to worry about which version their database is on so
they know which app to download from the Store.
As a possible workaround, is it ok for us to package all 3 versions of our app into a single Windows Store app, and then just have the app check at runtime which version it should run? I assume that this is alright, since we will not be downloading
any other code or installing any software/apps, as was the case with our original solution that violates the certification criteria. Essentially we would just have 3 different classes and determine at run-time which classes code we should run.
I know that this solution isn't ideal, as it means our app will be 3 times larger than it needs to be, and that an update to any one of the 3 versions of our software will require an update to the Store app (so potentially users may download a new version
of the Store app, even though it doesn't have any changes for the particular code version (i.e. class) that they will use), but it's one of the best alternatives we have come up with. I just want to check that this solution doesn't also violate any certification
criteria before we go down this road.
If this is not allowed then our only other alternative might be to go with sideloading (as
I discuss on this thread) and avoid using the Windows Store all together, but we would prefer to use the Store if possible as it eliminates a lot of overhead that we would have to deal with if we use sideloading.
Any insights or suggestions that you can give are appreciated. Thanks!
- Dan - "Can't never could do anything"Hey Mr_bigworlds, thanks for the reply. The moderator on this post actually told me that this
would be a better forum for my inquiries. I agree that there may be another forum better suited for this question (there are so many that I don't know about), but since this relates to Windows Store certification criteria, I don't think the Windows Desktop
Development forums are the place for it.
- Dan - "Can't never could do anything" -
How to use local .sdf database in a windows store apps
Hi,
I am new in windows store app development. I have been working in WPF application development for long time. Now I want develop windows store apps. I am studying on it. I got a problem. I what to store data from windows store app in .sdf database file. I
confused is .sdf database is compatible with windows store apps.
I want Deploy the apps in windows apps store. Is .sdf database support in client machine while he download it and run his own machine.
Please Suggest me about it with sample reference. It will be very helpful for me.
bye
With Regards
Sadequzzaman Monoj
BangladeshSDF files are used by Microsoft SQL Server Compact Edition. SQL CE is not supported for Windows Store Apps/Universal Apps. Only WP Silverlight Apps can use SQL CE. You will have to switch to a different database format.
As far as I know the only DB currently supported for local deployment with Windows Store Apps is SQLite.
This article gives an introduction on how to get started with SQLite in Universal Apps:
http://blog.tpcware.com/2014/04/universal-app-with-sqlite-part-1/ -
How to use .sdf database in a windows store apps
Hi,
I am new in windows store app development. I have been working in WPF application development for long time. Now I want develop windows store apps. I am studying on it. I got a problem. I what to store data from windows store app in .sdf database file. I
confused is .sdf database is compatible with windows store apps.
I want Deploy the apps in windows apps store. Is .sdf database support in client machine while he download it and run his own machine.
Please Suggest me about it with sample reference. It will be very helpful for me.
bye
With Regards
Sadequzzaman Monoj
BangladeshSDF files are used by Microsoft SQL Server Compact Edition. SQL CE is not supported for Windows Store Apps/Universal Apps. Only WP Silverlight Apps can use SQL CE. You will have to switch to a different database format.
As far as I know the only DB currently supported for local deployment with Windows Store Apps is SQLite.
This article gives an introduction on how to get started with SQLite in Universal Apps:
http://blog.tpcware.com/2014/04/universal-app-with-sqlite-part-1/ -
How to distribute my windows phone 8 app and windows store app without publishing in the store
How to distribute my windows phone 8 app and windows store app without publishing in the store
any business license or enterprise license needed..
I am a windows developer talking behalf of my company i.e wipro
I have a question about the enterprise license and we are building an app for the limited users i.e our company employees and users and we do not want to publish in the store
How to release the app?
what are licenses etc needed?Hi,
for developers distributing apps without Publishing in the Store, the sideloding Enterprise key license through volume licensing is required.
Starting May 1, 2014, customers who want to enable sideloading will be able to purchase an Enterprise Sideloading key for $100 through the Open License program.
An unlimited number of devices can be enabled for sideloading using this key.
thanks
diramoh -
Trigger Windows Store Apps update by script at first login
Hi
Is it possible to trigger Windows 8.1 to check for Windows Store Apps updates at first login?
My issue is that when I add language packs to my Windows 8.1 images, the default apps (Mail, Calendar, Food and Drinks) are still in English. Not until the Windows Store apps are updated will they change to the correct language (Language of the
OS). I have turned on autodownload in the registry using this registry key:
REG ADD "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" /v "AutoDownload" /t REG_DWORD /d 4 /f
It seems kind of random how long it takes before the autodownload kicks in. Some times it just a reboot and other times it takes like 24 hours. Can I trigger this update to start with some kind of script?
Thomas | MCP | http://www.techwork.dkI'd probably stick with the TechNet side:
https://social.technet.microsoft.com/Forums/en-us/home?category=w8itpro&filter=alltypes&sort=lastpostdesc
Don't retire TechNet! -
(Don't give up yet - 13,225+ strong and growing) -
My question is described below:
I have two disks, external hard disk and removable disk. They are formatted with EXT4.
I put the same image in the disks, and use Ext2Fsd to mount the disks.
I open the file in win8, and it will default open by the windows store app : photos.
It will be success to open if the file is in the Ext4's removable disk.
It will be failed to open if the file is in the Ext4's external hard disk.
I don't know why it will be failed to open if the file is in the Ext4's external hard disk.
Does anyone have similar experiences?Hi hatasum,
Thanks for posting!
Base on my experience, if installed Ext2Fsd, we can read the ext4 file system on windows system. But Which version of Ext2Fsd did you use? From my experience, Ext2Fsd is not spported fine about windows 8 version. Please refer to this software official
website (http://www.ext2fsd.com/ ) . I suggest you could post this issue to the Ext2Fsd discussion forum ( such as
http://sourceforge.net/p/ext2fsd/discussion/143329/thread/7f262ad0/ )for better help.
Thanks for your understanding.
Regards,
Will
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Tabbed page in a Windows Store App
I am creating a Windows 8.1 app (Windows Store App) and I need to have a tab-based page in this app. As an example, for adding a new contact, I need to group the new contact details in tabs which can be switched from the left side
menu items.
I tried to use a FlipView for this purpose but I don't want the users to be able to switch between pages by flipping. I want to create a page similar to
[Add a recipe] page in Microsoft Food & Drink app.
How can I do this?You can create a Page that contains a
Frame and switch out the frame as each menu item is clicked.
Matt Small - Microsoft Escalation Engineer - Forum Moderator
If my reply answers your question, please mark this post as answered.
NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
objects and unknown namespaces. -
System.ExecutionEngineException in a Windows Store App? - Why?
Hoping for some help from the powers that be or other resident experts, as I think this is one tricky problem.
I'm getting some seemingly random System.ExecutionEngineException events in my Windows Store app. Even though the error message itself is less than useless, when enabling native code debugging there does seem to be a connection to the use of streams and
possibly thread blocking. The call stack almost always contains a reference to SHCreateStreamOnFileW or similar stream-related functions (although that particular call is unsupported in WinRT, I'm assuming the kernel is calling it under the hood; I certainly
am not). In my own code, I do indeed utilize CreateStreamOverRandomAccessStream though so there's an obvious possible connection there.
I cut back on what was probably overly conservative use of EnterCriticalSection calls and that seems to have eliminated *almost* - but not all - of these insidious errors. Therefore I'm wondering if there's a connection between these errors and possible
thread blocking or competing locks? They also definitely seem to occur only when disk access is sluggish. So again, I'm thinking some issue with thread blocking while waiting for the disk. But just a guess.
What's particularly confusing is that the docs say this exception is obsolete, so I don't understand why I'd be getting it in a Windows store app.
Any insight would be appreciated!
Thanks,
PeterYou know what? I was just telling one of my testers today that I've only ever had an issue on my one laptop and no other machines. And he's never experienced it. (Outside the dev environment if just manifests as a random app crash and he hasn't reported
anything like that). Thing is the laptop is basically fine otherwise. Certainly no random app crashes except my own app. A few other data points. It only manifests in release mode so far. I've never seen it in debug mode. (Maybe code optimization could be
contributing?) I am using a fair amount of C#/C++ interop and a lot of multithreadimg. When the crashes do occur they are always when the app is doing things that use the C++ modules and specifically they utilize COM streams (which I implement
in C# to wrap .net streams) and synchronous disk read ops. IStream specifically. But the modules are always called from worker threads. They never block the UI thread. So that shouldn't be the issue. Even if it is my environment there should be a graceful
way to handle the error. As I said other apps don't just crash. Trying to think of what other relevant information I can give without getting into gory and irrelevant detail. Again any other insights appreciated. I'll try to grab a stack history next time
it happens (I have to be in native mode debugging to get any useful info). that will reveal more. Thanks so much. Peter -
[Forum FAQ] Go to Start Screen/Desktop when closing Windows Store App
After install Windows 8.1 Update 1, you will notice these things set by default even on touchscreen laptops and desktops:
Windows 8.1 now boots directly to the desktop.
Closing Windows Store Apps and go to desktop instead of Start Screen.
Besides option “When I sign in or close all apps on a screen, go to the desktop instead of Start” since Windows 8, another new option in Taskbar Properties “Show Windows Store app on taskbar” is used to control closing app behavior.
Features of "Show Windows Store app on taskbar"
When the setting is checked, all of the Windows Store apps that are currently running will display on taskbar. You can easily switch between Windows Store apps and your desktop and its applications through the taskbar. For mouse users,
you can also access the taskbar within a Windows Store app. Just move the mouse cursor to the button of the screen, the taskbar pops up.
When the setting is unchecked,
Windows Store apps have no minimize button, only Close button
Windows Store apps that are open are not visible on Taskbar
Windows Store apps can still be pinned to the taskbar
How do these two options work for closing app behavior?
Modern app and Taskbar setting
OFF
ON
Boot to desktop setting
OFF
Close goes to Start
Close reveals the app that was previously used, and eventually dead ends at the Desktop
ON
Close goes to desktop
Close reveals the app that was previously used, and eventually dead ends at the Desktop
Know why “When I sign in or close all apps on a screen, go to the desktop instead of Start” does not work when “Show Windows Store app on taskbar” is checked on
As MironV mentioned in the
thread, Windows 8.1 Update is designed to introduce a number of changes for mouse and keyboard users that would help them use and switch between Windows Store apps alongside their familiar desktop applications. A lot of these changes only made sense when
combined together, so they are toggled by one setting, which is “Show Windows Store apps on the taskbar.” This is usually enabled together with the first setting as a complimentary set of improvements for desktop users. When the setting is enabled, Windows
Store apps are intended to feel more like regular maximized applications living on the desktop, though they are full screen only. For example, when you launch apps from Start, they appear on the taskbar until they are closed. You can also minimize them or
switch between them by invoking the taskbar.
Please understand that unchecking the “When I sign in or close all apps on a screen, go to the desktop instead of Start" setting has no effect on close and minimize behavior when the “Show Windows Store apps on the taskbar” setting is checked, since
they are controlling two independent things. If you tend to use only one Windows Store app at a given time, it may seem like we’re not respecting the setting by going to the desktop.
Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.I don't know if I'm the only one, but on my desktop (using mouse and keyboard only) I like to have my Start screen as my main screen. To ensure this I made sure to uncheck the "When I sign in or close all apps on a screen, go to the desktop" box and
check the "Show Start on the display I'm using when I press the Windows Logo key" box. I also really like having the task bar appear at the bottom even when I'm using a modern app. Based on the settings I've chosen (i.e., boxes I've checked or not checked),
I would expect to be taken back to the start screen and not the desktop whenever I close an app. From what I've read from your response and from others in this thread, in order to accomplish this function (i.e., closing an app and going directly to the
start screen) I need to uncheck the "Show Windows Store apps on the taskbar" setting. By doing this I get the functionality I was looking for when the apps are closed and I get sent to the start screen. However, I am now not able to see the taskbar
when I'm in a modern app or when I'm on the start screen. This seems counterintuitive/confusing as many have mentioned. Not to mention it creates an additional step for users to get back to the Start screen.
All I want to do is (1) use my start screen as my main screen, (2) see the taskbar when running whatever app I'm using (e.g., modern), and (3) go back to my start screen (and not the desktop) when I close an app. It would only make sense that I should
get these results if I leave the "Show Windows Store apps on the taskbar" box checked and the "When I sign in or close all apps on a screen, go to the desktop instead of Start" box unchecked; but unfortunately this is NOT the case. I really hope that
an update fixing this is coming sooner rather than later because this is really annoying. -
How to use offline map for windows store app using c# and xaml
Hi friends,
I want to integrate offline map in my windows store app but I am not able to achieve that.
Below is my requirement:
When a user wants to go somewhere where she/he doesn't want to use wi-fi or mobile data but wants to use map to assist her/him to roam around. For this I want to give an option to download the map for that region/area before leaving for that place and there
she/he can use map even in offline.
Is it possible that I can achieve this using Bing maps?
If yes then tell me the processes to follow.
If no then can I achieve this using "Here" or by using any other API or by tweaking any way?
Note: I am showing maps in case of online and user can search for directions or any places in that. I am using Bing maps for that.
Thanks,
S.SandeepHi Sandeepmsandy,
There is no available code sample for this scenario. You may write your own.
Step 1: Get pdf URL from sqlite database. Please refer to the following MSDN blog and see a code sample.
http://blogs.msdn.com/b/robertgreen/archive/2012/11/13/using-sqlite-in-windows-store-apps.aspx. Note, you need to retarget the project to 8.1 and then get two sqlite packages from NuGet before building this sample.
Step 2: Use some special classes to get file from serer.
HttpWebRequest can help download small pdf files. For more information to see
https://social.msdn.microsoft.com/Forums/windowsapps/en-US/de96a61c-e089-4595-8349-612be5d23ee6/download-file-with-httpwebrequest?forum=winappswithcsharp. It’s easy for use, but if you want to download the larger or many files, it’s recommend to use
BackgroundTransfer namespace. The classes in this namespace provide a power way to transfer files in the background. See a code sample from MSND.
https://code.msdn.microsoft.com/windowsapps/Background-Transfer-Sample-d7833f61.
Regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate
the survey. -
Code signing Windows Store Apps
I can't get a very clear answer on the code signing requirement for deploying Windows Store Apps to the app store, even after searching the Internet for a couple of days. Specifically, my question is: are you required (not just recommended) to have a third
party Code Signing Certificate to publish to the Windows App Store?
I am not distributing the app to internal customers, but rather to external customers via the app store. If I'm missing this requirement documented in the documentation available on this site, can you point me to it?
MichaelAll methods of deployment (Windows Store, PowerShell or System Center Configuration Manager) require the application to be signed using a certificate. The Windows Store channel requires a signing certificate
from a publicly trusted CA because, well, the testers in the approval process won't have access to your internal PKI.
Visual C++ MVP
Maybe you are looking for
-
Logic Pro Crashing After Mavericks Update
Hey Guys, I'm not having any luck opening Logic Pro 9. Here's the report: Process: Logic Pro [619] Path: /Applications/Logic Pro.app/Contents/MacOS/Logic Pro Identifier: com.apple.logic.pro Version: 9.1.8 (1700.67) Bui
-
Table of Contents formatting issue
Table of Contents will not format properly when I change document margins. The TOC looked great until I had to adjust my left margin to 2inches for printing purposes. Now the page numbers are only a couple of spaces from each header, and it looks r
-
When a run time error occurs, Bridge or Photoshop returns an error dialog that gives the line and file # where the error occurred. Suppose the error was "line 57, file #8". Is there any way to find file #8, other than guessing which jsx file was bein
-
Ipad 2 gyroscope bug 7.02
Since upgrading to iOS 7.02, I have an issue where if I click an app it will spin upside down ie mail, safari , if I click the home button it will spin back the correct way, have tried a hard reset but no joy Any ideas Thanks
-
[SOLVED] Pacman GPGME error: No data
I recently bought a new computer and, of course, wanted to get away from windows 8 asap. I've installed arch several times before, and this time, from the outset, I've been plagued with GPGME errors. First was during the installation when I tried to