Click here to Skip to main content
14,641,030 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hello Everybody
I've a small Windows Service that connect via a socket to another Service.
when i install it on Windows Server 2012 it sends a message over the socket, fine.
when i restart the service, it sends a message over the socket, fine.
when i reboot the server it does NOT send a message over the socket.

Everything works as it should on Windows Server 2008r2.

what has changed Service wise on Windows Server 2012?

Best Regards
Updated 17-May-13 1:07am
NotPolitcallyCorrect 17-May-13 6:46am
There is not nearly enough information here to even begin.
"i install it on 2012", what is "2012"? I am not aware of any OS named "2012" available for you to install Windows services on.
"as it should on 2008r2", same thing.
The only thing I can imagine that 2012 and 2008R2 could refer to is SQL Server and you do not install Windows services in SQL Server.
alekcarlsen 17-May-13 7:04am
"you do not install Windows services in SQL Server." - then why would you imagine that i ment SQL Server? - let me answer your question with a question...
where do you install services - and which OS'es are named 2008r2 and 2012 where one could install a windows service?
i've edited my question to more correctly state which OS i'm talking about

here are some links

NotPolitcallyCorrect 17-May-13 7:20am
Thank you for clarifying. Mostly because "2008r2" can also refer to SQL Server and is not specific to Windows Server at all. You were not specific in what you are trying to do.
And to answer your other question, there are no OS's named "2012" or "2008r2" that I am aware of. There is an operating system named Windows Server 2008 that you could install windows services on but you could not do this in SQL Server 2008.
alekcarlsen 17-May-13 7:31am
it's implicit that im talking about "Windows server 2008r2" when i'm talking about a windows service, that i wrote, that i installed on the OS. and NOT SQL server. Because as you said "you do not install Windows services in SQL Server."
Now.. do you actually have an answer to my question?

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

It sounds like your service depends on a couple of other services (drivers) running before it can send it's packet.

I would modify your service registration to have dependancies on "TCP/IP Protocol Driver" and "Windows Firewall". It'll force your service to wait until those two services are running before it starts.
alekcarlsen 17-May-13 13:51pm
it has a reconnect method, that handles this. - still not working when rebooting windows 2012 server - but same thing works in 2008 - im curious as to what has changed.
Dave Kreskowiak 17-May-13 15:41pm
Well, it sounds like your reconenct code isn't detecting that it needs to do this, or it gives up too soon and/or retries too fast. This also depends on exactly how you implemented this reconnect code.
alekcarlsen 17-May-13 16:10pm
Well the thing, as stated numerous times.
The exact same code works fine in the same scenario on windows server 2008r2
Dave Kreskowiak 17-May-13 16:20pm
Without seeing the code, and there's going to be too much of it to post here, it's pretty much impossible to tell you what's going on.

There's nothing that changed that should have affected a service starting up and sending a TCP/IP packet. Most of what has changed has to do with security and services trying to put up a UI.
alekcarlsen 17-May-13 16:23pm
Ill post my code tomorrow.
But i cant figure out why the same code acts differently in 2 different scenarios on the same server - service restart.. The code connects and sends fine
But a full server reboot and it doesnt.
Dave Kreskowiak 17-May-13 17:23pm
I already told you what to do...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100