Jump to content

program wont run on terminal services

- - - - -

  • Please log in to reply
8 replies to this topic

#1
bart21

bart21

    Newbie

  • Members
  • Pip
  • 7 posts
hi

I have the source for a bit of software that displays an acceptable usage policy on screen for the user to accept. This works fine except not on terminal services.

TS user james logs on and policy displays. Whilst he is reading through policy user bob logs on, NO policy. James has now clicked ok and accepted/declined policy so next user to log on will now see policy.

Anyone willing to have a look and fix this for me so that it will work on terminal services?

thanks

nick

#2
Davide

Davide

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 506 posts
You haven't posted the sources or even a slight clue on how that policy thing works. How are we supposed to solve the problem?
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics

#3
bart21

bart21

    Newbie

  • Members
  • Pip
  • 7 posts
Ah yes,that does help doesn't it. Will post the source and more detail when I get to work.

#4
bart21

bart21

    Newbie

  • Members
  • Pip
  • 7 posts

Quote

AUP Informant displays your acceptable usage policy to users and gathers their responses. Unlike some solutions that simply show a piece of text, AUP Informant is capable of displaying rich web pages with images and even embedded media. It supports a secondary policy too, allowing you to display one policy for students and another for staff.

Of course, displaying your policy is only half the story. In order for your policy to be effective and enforceable you need to have proof that your users have read and accepted it. AUP Informant collects reliable data on your users’ responses and provides statistics and reports so that you can see at a glance which users have accepted and which have not.

Source code

description about what it does

Edited by Alexander, 22 November 2010 - 02:45 AM.
fixed [qoute]


#5
bart21

bart21

    Newbie

  • Members
  • Pip
  • 7 posts
I am really desperate for this program.

I am prepared to offer a donation to inspire people to help me by fixing this.

I dont know hhow long it will take but is £15 fare.

by paypal or postal order.

nick

#6
sam_coder

sam_coder

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 372 posts
ok, shot in the dark..

the biggest difference when you run through through terminal services, is that each client will be started up on the same machine.

When the client is running, does it bind to a port? If it did, and the first client already had it bound, the second would not be able to bind to it. So when the first exited, the third would.

taken from ConfigurationReciever
 class ConfigurationReceiver

    {

        private XmlDocument configuration = new XmlDocument();

        [COLOR="red"]private const int receivePort = 5025;[/COLOR]

        private IPEndPoint localEP = new IPEndPoint(IPAddress.Any, receivePort);

        public bool configurationReceived;


        public ConfigurationReceiver()

        {

            Thread responderThread = new Thread(receiveCurrentConfiguration) {IsBackground = true};

            responderThread.Start();

        }


        private void receiveCurrentConfiguration()

        {

            TcpListener receiver = null;


            try

            {

                receiver = new TcpListener(localEP);

                receiver.Start();

            }

            catch(Exception error)

            {

                //Unable to open listen port

                List<object> details = new List<object>();

                details.Add("TCP Port: " + receivePort);

                details.Add(error.Message);

                //Log.createLogEntry(EventLogEntryType.Error, "Failed to open TCP listen port. Exiting.", details);

                [COLOR="red"]Application.Exit();[/COLOR]

            }


hope that helps...

Edited by sam_coder, 08 December 2010 - 12:01 PM.
I guess I did review something


#7
sam_coder

sam_coder

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 372 posts
I also notice you have the Log entry commented out, likely why, if this is in fact the problem, it wasn't apparent to ya

#8
bart21

bart21

    Newbie

  • Members
  • Pip
  • 7 posts
ok, thanks for that. I did not write this, but i do have permission to get it edited as it is now open source.

What can i do to edit/fix my issue? I can see the bit where it binds to the port as you say, but it does it in 2 seperate files for 2 seperate ports.

Quote

private IPAddress serverIPAddress;
private const int serverPort = 5026;
private ClientResponse userResponse;
private string encodedResponse;

public ResponseSender(ClientResponse response)
{
serverIPAddress = Settings.serverIPAddress;
userResponse = response;
buildEncodedResponse();
sendClientResponse();
}
.........................................
namespace AUP_Informant_2.Backends
{
static class BroadcastSender
{

private const int broadcastPort = 5024; public static void announcePresence()
{
// Create a UDP client and bind it to the broadcast endpoint
IPEndPoint epBroadcast = new IPEndPoint(IPAddress.Broadcast, broadcastPort);

try
{
using (UdpClient client = new UdpClient())
{
........

is it hard to do as i dont know any c# programming?

nick

#9
sam_coder

sam_coder

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 372 posts
Let me think if I can find a way to explain this...
only one listener can bind to any one port. Once a port is consumed on a machine, it cannot be consumed again (at the same address).

I haven't reviewed the entire application, and it would be impractical for me to do so and make any specific problem solving recommendations.

but I'll make a few recommendations, first of all, those ports should not be hard coded. I don't think anyone would disagree with me.
But that wont solve your problem either. See even if you did make them configurable, the client is still installed in one place on the server that users are logging in to, and it's still starting up there. So you will still be in a position where the same port will be used.

In order to really know what to do, you kinda have to know why it was designed that way in the first place. In an ideal situation, the client would take an available port, and the server would connect to that...
in a possibly less ideal world, a work around might be to keep trying to start the application for a user until they do accepts the policy. So if someone else had it open, when they accepted or declined, it would free it up for the next. But that's not really a solution either, its a work around. =)


you will definitely want someone who knows what they're doing to make some recommendations.

What license is it under now? Is it hosted anywhere now like sourceforge? (you mentioned it was open source)
you may be able to get some interested developers involved, who can check out the site, get familiar, and start working out these issues.

I could possibly help with that, but right now my workload is pretty heavy, so I cant really get my hands dirty...




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users