|
I was going to describe the processing logic and came to the realization that the service doesn't have to be (and maybe should NOT be) a service. It could be a GUI app or a console app.
In any case...
1) The server app waits for a file to be written.
2) When the file is done being written, the server app posts a delimited string in the shared object.
3) The service (or client app) polls the shared object until the string it retrieves in different from the last one it processed.
4) It processes the string, and then returns to polling the shared object.
Items of note:
The client processes the string (much)faster than the server can indicate that a new file is written (we're talking anywhere from 4-50gb file sizes).
The client needs to be able to handle the server not running at any given time.
I have some code written, but the server and client don't seem to be talking to each other. I'm going to move away from the client "service" paradigm for easier debugging and see what happens. Running as a service introduces security concerns on Vista that I may not be handling correctly.
I'll start a new message thread if I can't get it working.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: 1) The server app waits for a file to be written.
Not sure if I will be correct since the "where, how, by what, in response to what", a file is written I do not know, but...
John Simmons / outlaw programmer wrote: 2) When the file is done being written, the server app posts a delimited string in the shared object.
3) The service (or client app) polls the shared object until the string it retrieves in different from the last one it processed.
4) It processes the string, and then returns to polling the shared object.
It does not strike me that Remoting is the most appropriate solution for that scenario. Have you considered using message queues?
|
|
|
|
|
John Simmons / outlaw programmer wrote: polls the shared object
To reiterate, this doesn't seem like remoting is the right solution if you're using a shared object.
John Simmons / outlaw programmer wrote: I'm going to move away from the client "service" paradigm for easier debugging and see what happens.
Definitely. Setting something up as a service is the last thing on the todo list. Write is a console app or a winform app, as you suggested.
Marc
|
|
|
|
|
Well I am far from an expert, and worked only in 2.0 version, no WFC experience, but...
The server has the "real" object and the client gets a proxy. The framework takes care of all all the networking and marshaling. The only parts you have to take care of are authoring the class to inherit System.MarshalByRefObject and configuration and maybe a server process (you can use IIS to host as server). Unfortunately there are many choices which complicates trying to get your head around it. I followed the Remoting Chapter in a book that started with the simplest and worked up through I think all of them in complete executing examples.
So like the first example goes something like this:
1) you create a MarshalByRefObject class in an assembly project. (very little code)
with a simple method.
here is what I used
public string GetTime(string sid)
{
string sret = String.Format("{0}@{1}", sid, DateTime.Now.ToUniversalTime().ToString());
Console.WriteLine("NetTime.GetTime: {0}", sret);
return sret;
}
2) you create a Server process project (Console) that references the assembly from step #1,
sets up the Channel(s) (port and/or protocol)
and registers the class. (very little code)
and does ???? to keep executing of course.
3) you create or use a client process project to reference the assembly
the client code asks for the proxy instance by providing the Channel information. (very little code)
and finally having the proxy object, calls the method.
That example has all the channel information hard coded, then you do one that uses a config file to contain the channel information then you do one that uses IIS to host as the Server. All of these require very little code.
The book was "Professional C# 2005"
|
|
|
|
|
i am having problem while installing vs.net 2005 and sqlserver 2005. Problem is that vs installs dotnet framework 2.0 and after installation of that when i tried to install sqlserver 2005 that installs dotnet framework 2.0 beta. they both conflict with each other.
2ndly plz tell me how to check whether sqlserver 2000 is correctly installed because when i run my application it always gives sql connectivity error i.e under default setting sql server doesn't allow remote connections. i am using win xp service pack 2.
|
|
|
|
|
hi friend
what u have written confilict it is not possible
remove your sqlserver in your control panel and install the sqlserver 2005
it work perfectly
|
|
|
|
|
i am having problem while installing vs.net 2005 and sqlserver 2005. Problem is that vs installs dotnet framework 2.0 and after installation of that when i tried to install sqlserver 2005 that installs dotnet framework 2.0 beta. they both conflict with each other. 2ndly plz tell me how to check whether sqlserver 2000 is correctly installed because when i run my application it always gives sql connectivity error i.e under default setting sql server doesn't allow remote connections. i am using win xp service pack 2.
|
|
|
|
|
ManiMughal wrote: sqlserver 2005 that installs dotnet framework 2.0 beta
Then you are using a beta version of SQL Server 2005 - Please don't.
ManiMughal wrote: how to check whether sqlserver 2000 is correctly installed
I thought you said it was SQL Server 2005. SQL Server 2000 does not install any .NET framework.
ManiMughal wrote: when i run my application it always gives sql connectivity error
If you are giving the machine name in the connection string then you must enable TCP/IP connections.
|
|
|
|
|
Can i get/set the comments on latest version of VSSItem(Visual Source Safe Item(File), I know there is an interface "IVSSItem" through that i can checkin/checkout/label etc, but I couldn't find a way to get/set the comments of the latest version, is there any way?
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
|
|
|
|
|
hi
how can I execute .Net programing on an OS that doesn't have .NetFramework!?
like win98!
|
|
|
|
|
Install .Net? .Net will install on windows 98.
There are commercial packages around that will allow you to run .Net apps without the framework installed but I belive these wont work on OS's that .Net doesn't support.
|
|
|
|
|
And those packages that let you avoid the .NET Framework cost a small fortune.
|
|
|
|
|
awwwww you spoiled the suprise :P
|
|
|
|
|
I'm such a party-pooper.
|
|
|
|
|
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Mono[^]
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Sorry without .netframework you can run your programm
.net framwrok 3.0 is free down load and run the programm
have a nice day
|
|
|
|
|
Hi,
I need to create and Ms-Word addin that will add a footer to all the pages of an open document. I have browsed and got some code.
I have referred MS knowledgebase article and have created an addin, but that code is not adding any button to the commandbar of Word. It did one for outlook. When I made some changes to the code to make it word specific, it still didn't do anything. I have written the following code in OnStartupComplete method:
object oMissing=System.Reflection.Missing.Value;
CommandBars cmdBar = wordApp.ActiveDocument.CommandBars;
try
{
this.myButton = (CommandBarButton)cmdBar["Tools"].Controls.Add(1, oMissing, oMissing, oMissing, oMissing);
}
catch
{
this.myButton = (CommandBarButton)cmdBar["Tools"].Controls.Add(MsoControlType.msoControlButton, oMissing, oMissing, oMissing, oMissing);
this.myButton.Caption ="Hello";
this.myButton.Style=MsoButtonStyle.msoButtonCaption;
}
this.myButton.Tag ="Hello Butom";
this.myButton.OnAction="MyAddin1.Connect";
this.myButton.Visible =true;
this.myButton.Click += new _CommandBarButtonEvents_ClickEventHandler(this.myButton_Click);
But this is not working. I am also not able to debug it.
Please help!!!!
|
|
|
|
|
Did you get it to work? I have been faced with the same issue.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I'm gonna try using remoting with an IPC channel. I haven't seen any evidence that a given remoting channel is bi-directional.
I'm either just not seeing it, or it doesn't do it. Can anyone tell me which is the case.
If a single IPC channel is not bi-directional, can a given app be both a client and a server?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
To use it bi-directionally you'll need to set the SerializationLevel to full.
Heres how you do that with configuration files:
note that this is for tcp and binary formatting but it's pretty much the same for any formatter and channel (with a few different attributes in the channel def).
client
<system.runtime.remoting>
<application name="xxx">
<client>
<wellknown type="xxx, xxx" url="tcp://127.0.0.1:xxx/xxx/xxx.rem"/>
</client>
<channels>
<channel ref="tcp" port="0">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
server
<system.runtime.remoting>
<application name="xxx">
<service>
<wellknown mode="Singleton" type="xxx, xxx" objectUri="xxx.rem"/>
</service>
<channels>
<channel ref="tcp" port="xxx">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
It can take some fiddling* to get the config files right but it's well worth it for the ease of configuration later on.
* read: days of looking for single wrong cased letters and trying different combinations.
See the way "wellknown" is all lowercase? when done progromatically they do it WellKnown. Because of that i put wellKnown and it took me agood couple of hours dealing with the inadiquate exceptions to find that one ... even had my boss over helping for an hour of that.
Just a note with the IPC channel. It has a bug with remoting events. Now most of the time you shouldn't rmeote events anyway but you'll often want to with IPC as it's obviously on the same machine and so not so bad to do. THe issue is that after your first client disconnects the server will break. heh ... not so good huh? This means for now you'll have to use TCP, but on the bright side if you use the remoting configuration files (and you should ) then its very easy to switch channels.
Heres the link to the connect bug report:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=293769[^]
Edit: forgot it doesn't like xml
|
|
|
|
|
Ya know, if you put a pre tag around that, it'll format...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I did ... and it still ate half of the tags :/
thats when I then switched to using html encoding X(
|
|
|
|
|
Either way, I can't seem to get my head around this remoting stuff.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
hmmm I'll try and put up an article on how I personally do it. I have the little exmaple project I came up with for that bug report which I'll try and pad out with an article. It covers most of the basics and imo impliments some important stuff which is often missing from remoting examples (like shared interfaces and use of config files).
I'll see if I can get round to it tonight (I'll be home in 2 hours) and post it up before I go to bed.
|
|
|
|