I have a small DLL that hooks into the spooler on windows platforms. It hooks the StartDocPrinter function, with the result, that every time a print job hits the spooler my DLL is called. This DLL worked fine on all platforms before windows 8.
The DLL are also able to hook into the windows 8 spooler.
The DLL makes a TCP/IP connection to a service, that can run on the local machine or on a remote server.
The problem is:
On windows 8 there are two "desktops", the native Metro desktop and a Windows 7 alike desktop.
If the service runs on the same machine and I submit a print job from the Windows 7 alike desktop the print job enters the spooler, the DLL is called and is able to connect to the service, but if I submit a print job from the Metro desktop (f.ex. select print from the Internet explorer), the print job enters the spooler, the DLL is called but is not able to connect to the service and recieves an 10060 TCP/IP errorcode.
If the service is on a remote server submitting print jobs from both desktops works fine.
When running the service locally, I have tried to use both 127.0.0.1 and the machines own IPV4 address, but the result is the same when submitting the print from the Metro desktop.
I have tried to disable the firewalls, but that does not solve the issue.
Anyone who knows what could cause this behavior?
Related
On our Windows Server 2016 machine, when I turn on the ASP.NET State Service and run "netstat -ab", aspnet_state.exe does not show up on the list of listening ports. However, on my development machine (Windows 10 Pro), aspnet_state.exe does show up. Both machines are running C:\windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_state.exe. Windows firewall is turned off on the server. I don't see any errors related to this service being logged in Event Viewer. Any suggestions on how to troubleshoot?
Im trying to let two uwp apps (windows 10 apps) communicate while running on the same machine. The Apps already can communicate when run on different hosts, so the code is working (both apps are enabled to communicate in local and public networks declared in their manifest files).
When running on the same host however, the client application is not able to connect to the server.
Im using Visual Studio 2015 Community Edition Update 3 for developing.
Under ProjectSettings->Debug->Allow local network loopback is checked.
I tried to ad an LoopbackExempt via commandline (for both apps):
checknetisolation LoopbackExempt -d -n=<packagefamilyname>
But still not working.
The code im using (thought might not be relavant)
Serverside code:
var listener = new StreamSocketListener();
listener.ConnectionReceived += Listener_ConnectionReceived1;
await listener.BindServiceNameAsync("20000", SocketProtectionLevel.PlainSocket);
Clientside code:
StreamSocket socket = new StreamSocket();
_hostName = <hostname/ip>;
await socket.ConnectAsync(new HostName(_hostName), "20000",SocketProtectionLevel.PlainSocket);
The loopback exemption will allow the app to connect out to the local system as a client, but it won't let the app receive local connections as a server.
See the Note on MSDN in the article How to enable loopback and troubleshoot network isolation (Windows Runtime apps)
Note Loopback is permitted only for development purposes. Usage by a
Windows Runtime app installed outside of Visual Studio is not
permitted. Further, a Windows Runtime app can use an IP loopback only
as the target address for a client network request. So a Windows
Runtime app that uses a DatagramSocket or StreamSocketListener to
listen on an IP loopback address is prevented from receiving any
incoming packets.
There are several other options depending on what exactly the need is. The most likely two are:
If the goal is only for testing then run the apps on different systems.
If the goal is IPC then implement an App Service. App services are specifically designed for UWP to UWP communication
If you're side-loading (which you'd need to be doing to call checknetisolation anyway) then you can also look into adding a brokered Windows Runtime Component or a desktop app as a broker server which both clients can connect to, but I'd definitely check out the app service option first.
I created localhost website in asp.net in Visual Studio and i added there a MSSQL connection.
My problem is that I created an app for windows phone 8 but i dont know how to connect this app with database which is on this website.
Can you help me with this?
First of all: your Windows Phone app can't connect to a SQL Server database, so you'll have to create an API.
Since you're using ASP.NET, I suggest to have a look at Web API. In short: you'll have several URL endpoints which return json/xml to your Windows Phone app. It's your job to query the database and return a single item/list of items in the controller of that URL endpoint (this sentence will make sense if you read into creating a Web API).
Next task is connecting to this API. Normally you would host it on a public url, so your phone device can connect to it (a phone doesn't know about your pc's localhost). If you want to use localhost with the emulator for testing, you'll have to execute the tasks mentioned in the quote below as this doesn't work out of the box.
When you create a WCF web service in Visual Studio, by default the
service is hosted in IIS Express and only accepts connections at
http://localhost/. Apps that target Windows Phone OS 7.1 can connect
to the development computer as localhost because the Windows Phone 7.1
emulator uses the network connection of the development computer. The
Windows Phone 8 Emulator, however, configures itself as a separate
device on the network. As a result, an app running on the Windows
Phone 8 Emulator can’t connect to the development computer as
localhost. Before you can connect successfully from the emulator to
the local web service, you have to make two changes:
You have to configure the local web service and web server to accept connections from other devices on the network.
You have to configure the service reference in the Windows Phone app to connect to the service by using the IP address of the development
computer on which the service is running.
Source: https://msdn.microsoft.com/en-us/library/windows/apps/jj684580(v=vs.105).aspx
I have an ASP.NET project (VS2008 on Windows 7 with either webforms, MVC1, or MVC2 -- all the same result for me) which is just the File->New hello world web project. It's using the default ASP.NET development server, and when I start the server with F5, the browser never connects and I get a timeout. I tried to debug this by telnetting to the development server's port while it was running, and I got the same result:
C:\Users\farmercs>telnet localhost 54752
Connecting To localhost...Could not open connection to the host, on port 54752:
Connect failed
I can see in the system tray that the server thinks it's running, and a netstat -a -n command shows that there is indeed an active TCP listener on that port.
This worked in the not-too-distant past, and I could work on web projects using the development server. One thing that has changed since then was that I installed the Microsoft Loopback Adapter to accommodate a local development Oracle installation. I'm not sure this is the problem, but it seems a likely culprit.
I also tried to hit the port using the server name itself (http://mycomputername:54752) but with the same result.
So, what could be blocking me from connecting? And if it's the loopback, then what is a good way for me to retain my ability to connect to my development Oracle server while still being able to use the ASP.NET development server?
have you checked your host file?
%SystemRoot%\windows\system32\drivers\etc\host
look if there is any redirection of localhost or 127.0.0.1 to somewhere else rather than your pc
I've got a very simple Windows Form app that hits an IIS 7 site about 2000 times in the space of a few seconds (using threads).
When I run that app on the server itself, using either localhost or the ip address, everything is totally fine.
However, when I run the app on my dev box, using the ip address, I get an error from the "GetResponse" method:
The operation has timed out
The App can definitely connect to the site, because it consistently either starts throwing the timeout error after 10 or so hits (no more than 11), or it throws the timeout error immediately.
What's going on?
It's hitting IIS 7 on a Windows Server 2008 VM (external box), Windows Firewall is OFF.
My App is running locally on my dev box as the admin.
cheers
I believe the default thread pool size for IIS is about 10 threads. You're overloading that single server.
Are you doing performance testing? Do you expect that many requests, that fast, in production?