Terminal Services
am 11.01.2007 18:05:49 von AMDRIT
Hello Everyone,
We have an application nearly a year in production. Recently, we have
deployed it to a Terminal Services farm for some of our users. For the most
part, everything is running fine; however every once in a while an odd error
occurs. We have not been able to replicate these issues on our local
workstations, either production mode or in debug mode.
When the error occurs, the application exits out and the user must restart
the app. Since we don't capture state data up until the crash occurs, this
is the desired activity. Once the user restarts the application, they do
not encounter the issue performing the same actions.
The issues do not occur all that often, perhaps once or twice a day for only
one or two users.
This is primarily a data entry based application connecting to a SQL server.
There is some use of reflection but that is really as extravegant as we get.
Since the issues only occur on the terminal servers, we were hoping that we
haven't accounted for some compatibility issue. The application is
installed locally on each terminal server, all sessions on a server run the
exe from the same directory.
Please flood me with suggestions on how to resolve the issue.
VB2005, XP/W2K3 TS
Thanks.
RE: Terminal Services
am 11.01.2007 23:33:00 von VirgilioArciniegas
Are you saving application data to the registry?
If so, make sure you do it to the HKEY_CURRENT_USER hive and not the
HKEY_LOCAL_MACHINE.
Terminal Server or Citrix Presentation Server are very temperamental about
this.
"AMDRIT" wrote:
> Hello Everyone,
>
> We have an application nearly a year in production. Recently, we have
> deployed it to a Terminal Services farm for some of our users. For the most
> part, everything is running fine; however every once in a while an odd error
> occurs. We have not been able to replicate these issues on our local
> workstations, either production mode or in debug mode.
>
> When the error occurs, the application exits out and the user must restart
> the app. Since we don't capture state data up until the crash occurs, this
> is the desired activity. Once the user restarts the application, they do
> not encounter the issue performing the same actions.
>
> The issues do not occur all that often, perhaps once or twice a day for only
> one or two users.
>
> This is primarily a data entry based application connecting to a SQL server.
> There is some use of reflection but that is really as extravegant as we get.
> Since the issues only occur on the terminal servers, we were hoping that we
> haven't accounted for some compatibility issue. The application is
> installed locally on each terminal server, all sessions on a server run the
> exe from the same directory.
>
> Please flood me with suggestions on how to resolve the issue.
>
> VB2005, XP/W2K3 TS
>
> Thanks.
>
>
>
Re: Terminal Services
am 04.10.2007 19:26:54 von AMDRIT
Is there nobody that knows how to work with RDP or is everyone just ignoring
me? I don't know where else to post my questions and my need is still real,
I am just looking for the formula to have two way communications via RDP.
"amdrit" wrote in message
news:%23yLeXzdBIHA.1164@TK2MSFTNGP02.phx.gbl...
> Thanks Sam,
>
> I have included the networking group in this post.
>
> Currently I am working with documentation found:
> http://www.microsoft.com/technet/archive/termsrv/maintain/fe atusability/tsrvapi.mspx?mfr=true
> http://msdn2.microsoft.com/en-us/library/aa383580.aspx
> http://msdn2.microsoft.com/en-us/library/aa383853.aspx
> http://www.codeproject.com/cs/system/TSAddinInCS.asp?df=100& forumid=358838&exp=0&select=1961960
>
> That is all I can really find about the topic.
>
> I am still having problems with WTSVirtualChannelRead, at least I think I
> am. Nothing seems to be writtin.
>
> Here is a brief overview of What I have done:
>
> I created a messagelib that will contain messages I am sending back and
> forth.
>
> Class MessageHeader
> int MessageType
> MessageBase Message
>
> Abstract Class MessageBase
>
> Class StatusMessage: MessageBase
> String StatusText
>
>
> Now on my session component I do:
>
> 1. Call WTSVirtualChannelOpen to get a handle on the channel
> 2. Create a StatusMessage
> StatusText = "ACK"
> 3. Serialize the message
> 4. Send the message
>
> Now on my client component I do:
>
> 1. VirtualChannelEntry waits to be called (This is what loads the
> assembly), store the handle in mHandle
> point my VirtualChannelInit to the function
> VirtualChannelInitEventProc
> 2. Once the VirtualChannelInitEventProc determines that a complete
> message was send over, I deserialize and process the message
> 3. Determine the type of message that was send (type == 1
> //StatusMessage)
> 4. Determine what the StatusText is "ACK"
> 5. Generate a reply StatusMessage "NACK"
> 6. Serialize the message
> 7. Send the message
> a. open the channel using the WTSVirtualChannelOpen(mHandle,-1,
> "Impact"), store the new pointer in intTemp
> b. write the data using WTSVirtualChannelWrite
>
> at this point, I believe my data is waiting for the server to pick it
> up. I get a true returned from WTSVirtualChannelWrite
>
> Back to the session component
>
> I have a background worker process that is monitoring for pending
> messages.
>
> 1. Open the channel with WTSVirtualChannelOpen
> 2. Read until there is nothing left to read, add the read bytes into
> list using WTSVirtualChannelRead
> 3. If anything was read
> a. Deserialize the MessageHeader
> b. Determine Message Type (type == 1//StatusMessage)
> c. Report StatusText "NACK"
>
> At this point, nothing is read by the WTSVirtualChannelRead. I don't
> know where my message is.
>
> Does anyone have any ideas of where to start?
>
> BTW, I am using C# 2005. But the concept should be the same.
>
> Thanks in advance.
>
>
> "Sam Hobbs" wrote in message
> news:OKM2HOdBIHA.3548@TK2MSFTNGP06.phx.gbl...
>>I have made less progress than you. I know the documentation is vague and
>>that there are not articles .... wait I think there is an article I found
>>when I searched, but I forget where it is. I searched the MSDN and the
>>internet using relevant function names.
>>
>> I assume the networking newsgroup is more likely to get answers.
>>
>>
>> "amdrit" wrote in message
>> news:%23JyHIhcBIHA.912@TK2MSFTNGP05.phx.gbl...
>>> Hello,
>>>
>>> I am seeking guidance on working with virtual channels through terminal
>>> services. I hope this is a good spot to post.
>>>
>>> I think what I really need to understand is the order of operation for
>>> conversations on the channel.
>>>
>>>
>>> I have been able to create a component and create a registry entry for
>>> the channel in the terminal services add-on. I have successfully opened
>>> the channel from the terminal server and pushed a message down to the
>>> client machine.
>>>
>>> What I have not been able to do is respond to the message from the
>>> client box. Any attempt write to the channel from the client causes
>>> mstsc to crash.
>>>
>>>
>>> MSDN does not really expound on the api, certainly it describes each of
>>> the api calls and structures. I am assuming that once the channel was
>>> opened and I have a handle to the channel that I can simply
>>> call WTSVirtualChannelWrite to write back to the session application.
>>> Even if the session application wasn't listening for the message, it
>>> should be that simple.
>>>
>>> Now the next question is how do I poll for messages pending to be read
>>> by the session application? Since I am not supposed to be blocking, I
>>> don't know how to peek into a queue. I assume that I can use
>>> WTSVirtualChannelRead, but I don't know how big to the pending message
>>> will be.
>>>
>>>
>>> Any help on the subject is greatly appreciated.
>>>
>>> Thanks in advance.
>>>
>>
>>
>
>