|
Hi, I'm actually working on a school assignment and need some help. The assignment is a world simulation. On this world you can add animals and stuff. The application is already working remotely. Each pc acts as client and server. What I still need to do is to make sure that when a (server)pc (a world) is shut down or crashes, that one of the other pc's in the network becomes the server with the data.
Can someone point me in the right direction or does anybody know where I can find a sample of something similar?
Any help is appreciated.
Thanks in advance.
|
|
|
|
|
iits pretty simple. google for it. theres lots of examples
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Thank you Ista for your reply. I've have already tried google. But I don't know exactly what to search for. I did find some simulation, but I didn't find anything that has to do with when a server shutdown/crashes and one of the other pc's in the network has to take it's place. Anybody know where I can find a sample or something?
Thanks in advance.
|
|
|
|
|
add a little pinging routine that checks to see if the server is alive, if not cycle through the next item in the array.
You just need a simple loop.
You will also need to open channels programmtically.
I would diagram the problem out and list the possible scenarios so you can come up with a possible solution.
But basically if you try and open a chennel and it doesn't work then the server is dead.
You could do this: Create a class that channels the requests through and picks the server to contact. It would be imitation of load balancing. Check out "design patterns" on google till you find one that meets your situation.
Nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I have a dll that I've written that uses a class to store settings that is serialized to an xml file so it can be easily edited by the end user. This works just find with a simple C# tester program, the settings can be serialized and deserialized without any problems. However, I need to call this dll from a LabView program and there it will not work. I've narrowed the problem down specifically to the deserialization of this settings file which throws an invalid cast exception. Anybody have any ideas why the deserialization would work fine when the library is called from a C# program and not when its called from LabView?
|
|
|
|
|
Can you give us more information on what LabView is? If it's a program that you own, does it have a reference to the Library that contains the classes are serialized to the file?
Jared Parsons
jaredp@beanseed.org
http://spaces.msn.com/members/jaredp/
|
|
|
|
|
LabView[^] is a horrible torture device that National Instruments tries to pass off as a "programming language".
It's supposed to be able to act as a client for .NET classes but it's been giving me all kinds of trouble. The actual class being deserialized though is called from another .NET dll (that LabView loads itself) that loads the assembly that contains the class to be deserialized. If I skip the deserialization it works fine (sort of, it actually has a habit of hanging when I try and quit!)
|
|
|
|
|
Hi
I had a question abt the Inconsistent Read concurency issue with my application's data access that I am currently developing. Here is my problem. I am using custom business objects that represent my database entities. For example, in one of the web pages displays a list of users in a datagrid bindng it to customcollection that holds user objects (instance of my user class). I am using Enteprise Library to do my dataccess. my DAL would read the data from the database (makes a call to the store procedure) and pass the custom collection of user objects to the UI. When the user clicks on any row of the displayed list, it takes himt o another page that displays further details of that particular user and he may update them. Do I need to use any lock options while reading the data from the database? I mean optimistic concurrency control?
Any suggestions would be greatly appreciated...Please help.
Thanks
|
|
|
|
|
I didn't think that this question was appropriate for the ASP.NET forum but I will mention it in this question.
I currently have an ASP.NET page that receives an XML stream which I write to disk.
StreamReader reader = new StreamReader(Request.InputStream);
string xmlData = reader.ReadToEnd();
...
StreamWriter writer = new StreamWriter( "Somefile.xnl, false);
writer.Write( xmlData );
writer.Flush();
writer.Close();
I would like to have this functionality using a Web service instead of an ASP page.
It is possible to use a web service to receive posts in this fashion?
Any pointers appreciated
|
|
|
|
|
yes. send a stream to it and save it
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Would you care to elaborate a little.
I am very new to web services. My team lead is wanting me to do this without a IIS server even running.
What do you mean by send a steam to it? Then how do you save it, how does the webservice get hold of the stream.
Note: I have no control of how the stream is sent to me. I give them a url to post to and they send me an stream formated as xml.
Thanks
|
|
|
|
|
Okay. define the web services as a memory stream
like maybe
public void SendMyData( MemoryStream ms )
{
// Write the text to the file here
}
So the user will call your web service and send them stream to you. And you can what you want with it.
Your PC will have the IIS on it so any PC that has IIS can hold the web service. Not having a web server to deploy is just crazy!
But the programs will simply locate your WSDL file and they will see they need to send a Stream to it.
You don't have to use a memory stream, it's just one I use a lot. Play with it.
When you create the web service it creates the WSDL. So Create another app and click Add Web References and find the wsdl then call it. Its easy
If you need help I will up for for another 3 hours
Nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I follow what you are saying.
I realize that not having a web server to deploy it crazy, but I have been asked to look into this method.
The problem that we are trying to get around it the limitation of IIS 5 running on XP, which is 10 conncurrent connections. Of course this could be solved by switching to 2003 server and IIS 6 but that is not the exercise.
Given that explanation is there a way to do what my team lead wants, even if it's insane, I need to go back to him with some answers.
Again in a nut shell here is what he wants.
1) create a web service independent of a IIS server.
2) have this web service receive the data sent my our client.
It seems to this that this would require socket programming as I don't see how a web service could receive streams without a server.
Thanks
|
|
|
|
|
well a web service is a (web) and is know way independent of IIS.
You could host IIS on a win2k machine. It doesn't have to be a server.
Now you can imitate the web service by doing remoting. and just open a port or listen on port 80 for data coming through. After all, a web service wraps remoting.
Its a simple concept but you'll need to practice it.
http://www.csharphelp.com/archives2/archive422.html[^]
I would say set up a win2k machine that doesn't exhibit such behavior. If not, do remoting but it will be a learning curve.
Its a shame when companies do this over a few dollars. Hes going to spend more in the long run.
Make sure you do tons of exception handling.
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Thanks for the information.
I don't believe it's over a few bucks, I believe he has two motivations.
1. He is from a non-Microsoft background... and he doesn't want to use ISS any version on any
machine.
2. He wants to find a way for the client to send info directly to our application with out a
middle man or web server.
I am with you. Why reinvent the wheel. I will look at the remoting to make our point to him.
Cheers
|
|
|
|
|
Hi,
Im a new guy in C# dev. I need to develop a component The requirement is..
I will be fetching a recordset from database which is of type dataset.(no problem for me here)
I will be taking the datatable out of the dataset which is having four coloumns..ie OrderID,OrderDate,ItemName,ItemID.
The requirement is to generate a XML file for each OrderID in the datatable.
One OrderID may be associated with Multiple ItemID and ItemName...
I need to filter out the table so the i take One OrderID and associated coloumns(orderdate,ItemID,ItemName) and send those values to other method cof generating the XML string.
Here im having some trouble , How to filter out and form the child table which is having One orderID and other values?..
Please give some eg code
thanks in advance
kotteesh
Happy coding!!
kotteeswaran
|
|
|
|
|
Create a DataView for the table.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa,
Can you give some sample code or link
thanks
Happy coding!!
kotteeswaran
|
|
|
|
|
|
I have code that allows me to basically write the contents of a richtextbox to a bitmap (sending a EM_FORMATRANGE using SendMessage). This code works fine, but it always draws the text "normal size" regardless of the setting of ZoomFactor in the RichTextBox. How can I get the "zoomed" verison of the text into a bitmap?
Thanks in advance!
|
|
|
|
|
Why don't you try zooming into the extracted bitmap? Let me know if you need the code to zoom into an existing bitmap
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Hi Polis,
I'm interested in the "zoomed" output of the RichTextBox because it does a nice job of scaling the fonts rather than the "blocky" output of scaling a bitmap. Is this what you're referring to?
Thanks!
Lori
Polis Pilavas wrote: Why don't you try zooming into the extracted bitmap? Let me know if you need the code to zoom into an existing bitmap
|
|
|
|
|
Hey Lori,
No, what I was referring to was to zoom into the image after it's extracted. Sorry I can't help you with that since I don't know how you get the bitmap in first place.
If I were you, most probably I would extract the bitmap like you do, then zoom into the whole image, and crop out the parts I wouldn't want to show.
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Hello there!
I have been working on this and cannot get it to work for the life of me. I am simply just trying to add rows to a dataset.
I recieve no errors. The datatable does update when I click refresh, but I do not see the rows added.
Can anyone please help me where I have gone wrong?
RCIDBphase1DataSet RCIDB = new RCIDBphase1DataSet();
private void submitbutton_Click(object sender, EventArgs e)
{
RCIDB.jobintake.Rows.Add("test", "test");
RCIDBphase1DataSet.EnforceConstraints = false;
RCIDB.jobintake.AcceptChanges();
this.jobintakeTableAdapter.Fill(this.RCIDBphase1DataSet.jobintake);
RefreshDataset();
}
private void RefreshDataset()
{
this.jobintakeTableAdapter.Fill(this.RCIDBphase1DataSet.jobintake);
}
-- modified at 11:37 Friday 9th December, 2005
|
|
|
|
|
Did you try taking a look here[^]?
Regards,
Polis
Can you practice what you teach?
|
|
|
|