473,387 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

C#: Cross-Thread Problem

Greetings,

First I'd like to say that this is a very nice forum and it already helped me alot with some other projects. But now to the problem:

I wrote a server that is based on the code found here . This server allows me to handle multible clients/connections at the same time.

Now I need to add an event (for example a key is pressed), which then sends a specific message to all clients that are actually connected. The problem here is that I dont know how to do that, since there are multible threads running the same code but with a different client.

Since the control that sends the event is in the main thread, it has something to do with cross-thread operations.

Does anyone have an idea?

Thanks in advance
Feb 7 '08 #1
5 2006
kenobewan
4,871 Expert 4TB
Is this event based around a time, admin initiating or user?
Feb 7 '08 #2
Is this event based around a time, admin initiating or user?
No, that event is not around a time, its coming from an external source and then needs to be transmitted to the clients. It would be also nice if I could "forward" the message coming from the event to the clients, but thats a different task. So just basically get the server to send a message to the clients as soon the event occurs.
Feb 7 '08 #3
Greetings,

First I'd like to say that this is a very nice forum and it already helped me alot with some other projects. But now to the problem:

I wrote a server that is based on the code found here . This server allows me to handle multible clients/connections at the same time.

Now I need to add an event (for example a key is pressed), which then sends a specific message to all clients that are actually connected. The problem here is that I dont know how to do that, since there are multible threads running the same code but with a different client.

Since the control that sends the event is in the main thread, it has something to do with cross-thread operations.

Does anyone have an idea?

Thanks in advance
Few years back when i was learning .net 1.1, we used to do Remoting for such scenarios...my memories are all dried up but i thought if u think on these lines you would be able to solve it.
Feb 8 '08 #4
Remoting for such scenarios.[..]
Well, Remoting sounds interessting, but the connection is also used for other things, so I will use TCP connections.
Noone has an idea how I could solve that?
Feb 8 '08 #5
Noone has a good idea? I still have the same problem and I cant find a solution.
Feb 13 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
12
by: * ProteanThread * | last post by:
but depends upon the clique: ...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
4
by: David Peach | last post by:
Hello, hope somebody here can help me... I have a query that lists defects recorded in a user defined date range. That query is then used as the source for a Cross Tab query that cross-tabs count...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
1
by: Rob Woodworth | last post by:
Hi, I'm having serious problems getting my report to work. I need to generate a timesheet report which will contain info for one employee between certain dates (one week's worth of dates). I...
3
by: aspmonger | last post by:
Hello, I really believe that IE 6 has a new (intentional?) bug that severely limits the capability of dhtml and cross domain scripting. Yesterday, I read an interesting article about the subject and...
6
by: Robert Bravery | last post by:
Hi all, Can some one show me how to achieve a cross product of arrays. So that if I had two arrays (could be any number) with three elements in each (once again could be any number) I would get:...
7
by: Charles | last post by:
I'd like to develop a simple cross-platform application in C++. I'd like it to run in Windows, OS X, PC-BSD and Linux. From my research, it seems I should use Qt or Gtk as a graphical library. Do...
6
by: Bart Van der Donck | last post by:
Hello, I'm presenting my new library 'AJAX Cross Domain' - a javascript extension that allows to perform cross-domain AJAX requests. http://www.ajax-cross-domain.com/ Any comments or...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.