|
Hi,
In my application i am using multi threading.For each thread i am calling an exe using System.Diagnostics.Process .What my doubt is if i have 100 threads then i need to call that exe for 100 times so will this degrade the performanace of application .I was not able to handle that code (which has written in exe) in my project thats why i hav written that in seperate application and calling that exe in my project.Just i wanted to know is this a correct way.
Thank You
|
|
|
|
|
I think it will definitely degrade the performance. You can use ThreadPool to limit/control the concurrent threads that load your external program.
Regards,
Lev
|
|
|
|
|
100 threads are rarely if ever going to perform as well as a couple of well though out threads. Not unless you have 100 processors.
I can't work out exactly what you're doing, from your description.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I dont know so much about C#, but cant you start a bunch of threads in one exe module. In C++ there are Threading-Functions, like AfxBeginThread which do so.
You probably got to redesign than your code.
Greetings from Germany
|
|
|
|
|
I am developing an e-learning application. When I draw anything in my custom control, each and every X,Y position send to the server one by one. From the server each message received sends to all the connected clients. I am using socket connection for this. The message will be like “X:Y:Type”, for eg:- “10:20:Line”. So when I draw a line number of such message are send to the client.
Server receive message from IAsyncResult in byte array and it send to all other connected clients.
Each message should like “X:Y:Type” for eg:- “10:20:Line”
My issue:
When I draw a line little fast in a client side all the messages are jointly send. For eg:- instead of “10:20:Line” message looks “10:20:Line10:21:Line10:22:Line10:23:Line10:24:Line10:25:Line10:26:Line10:27:Line” like this. If I draw the line slowly its working fine, messages are received one by one and the drawing is ok.
How can I receive the message one by one when client draw very fast or using slow network connection.
Regards
YPKI
|
|
|
|
|
Queue them on the server, and send them with the appropriate break between them, or a break character.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
please give more explanation about how to do queue and break
Regards,
YPKI
|
|
|
|
|
Just add items to a list as the person draws and your code to send the items, should insert some sort of line break between them, or should wait a certain amount of time before sending the next one. Hard to be more specific without seeing the code.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Please check the following code.
//Client side code
public void SendMessage(int x,int y,string msgType)
{
string str = x.ToString() + ":" + y.ToString() + ":" + msgType; // “20:10:Line”
Byte[] byteDateLine = Encoding.ASCII.GetBytes(str.ToCharArray());
m_sock.Send(byteDateLine, byteDateLine.Length, 0);
}
//Server side code
public void OnRecievedData( IAsyncResult ar )
{
SocketChatClient client = (SocketChatClient)ar.AsyncState;
byte [] aryRet = client.GetRecievedData( ar );
string message = System.Text.Encoding.ASCII.GetString(aryRet, 0, aryRet.Length);
Console.WriteLine("Message :- {0} ", message);
}
In a same ip address the message is sending correct and drawing is ok. When it come diffrent ip address the message getting concatenated.
Regards YPKI
|
|
|
|
|
OK, so like I said, the most basic thing you can do, is to add a character, like say !, or \r, or something, and then split your string when it comes in, on that character, so you get the individual messages one at a time to process.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
i have a web service and when it get the ID it talks to Db and get the relevent infrmation, my application also need to get this information at the same time, (infomation relevent to the ID got by the web service)can any one suggest a way for this problem
|
|
|
|
|
What application ? What's the relationship here ? You can't do what you want to, unless you create a network connection between your webservice and your application, or your app exposes a webservice somehow.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
both are in the same system but they are not interacting with each other,the web service is used by the mobile device and it talks to Db through web service,once it get the id as an input,
my desktop application wants to monitor the user who enterd the id to mobile device and keep records about the user.
|
|
|
|
|
actually what i want is ,when the mobile device call the web service the web service should send the information to ny desktop application as well as the mobile device
|
|
|
|
|
You have a design problem, your desktop app has no association with your service. I would add another interface to the service to be used by the DT app that sends the monitored information.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yep, and like I said, you need something listening on the desktop side to do that. Do you REALLY need that, or would it suffice for the desktop app to show data from it's own calls to the webservice ? If you need it to update itself, what if it called the webservice every minute to find out about any new data ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
thanx,as you says i have to create an interface to the web service isn't it? i don't want to call the web service diectly, instead i just wnat to get the infromation which got by mobile device,
i tried to achieve this by creating a tcp client in web service and creating a server scoket in my DT app. when the service is called it writes data to the socket in the DT app, do you think this is possible and is there any disadvantages?
|
|
|
|
|
If your app can call the webservice to announce it's IP address, then you could set up a TCP/IP connection directly. I still think polling a webservice is a better idea.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
Is there any open source SMTP server written in C# with the below functionalities:
1. Receive mails from SMTP clients
2. Queue in any medium (DB or filesystem)
2. Delivering of mails (mentioned in to address)
It would be great if you can help me to find one . Most the open sources i came across does not support delivering of mails.
|
|
|
|
|
Tiger456 wrote: Most the open sources i came across does not support delivering of mails.
Why do you need this ? You can just send mail with 3 lines of code using your ISPs mail server ( and any server you find, is going to need to do the same ).
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: Why do you need this ? You can just send mail with 3 lines of code using your ISPs mail server
Yes i agree with you. But my reporting person need in this way. As we are are sending bulk mails to customers
|
|
|
|
|
i use to be a java , j2ee , csp , php programmer
currently start using c sharp
i know that asp is a server scripting language.
currently im building a standalone program
and i need to build a olap grid
c sharp datagridview bring a lot restriction
however html grid view give me the full functionality of it.
with asp integration my grid will be more interactive
somehow i find it a bit difficult to integrate that asp in the c sharp
without put it in iis server.
how can i solve it ?
if that is impossible ....or too hard since it is a sever scripting language
should wpf be the another solution for this?
|
|
|
|
|
1 - we have an ASP.NET forum
2 - ASP and ASP.NET are two different things
3 - No, you can't run ASP.NET without IIS, in the same way that you couldn't run PHP or J2EE without a web server, surely ? However, you must be very confused, b/c the C# grid is at least as powerful as the ASP.NET one. I'd say the problem is that you're looking at the wrong class.
WPF has next to no grid support, I am just struggling with that, myself.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
em... thanks for your guidance
your reply have been very helpful to me.
it would be great if scripting language can mix with standalone program.
so other code can combine to stronger combination since every language have their own weakness.
|
|
|
|
|
IN one project they used appsettings 4 Msn live search.In my project they asked to use MSN but it's settings
so how to define appidsearch in settings.They didn't use the add key
Thanks
|
|
|
|