VS 2008 Multi-threaded TCP Server / Client?
Nov 14, 2009
I'm having some trouble creating a multi-client server / client thingy.So far, I've used Atheist's example and allowed the clients to successfully transmit information.However, whenever I send more than 1 message to the server at the same time, the server bugs up and does not receive the message at all. I suspect it has something to do with the DoRead method reading from both clients and stuffing it up or something.
View 13 Replies
ADVERTISEMENT
Aug 10, 2009
Multi-User Chat Program (Server & Client) with Main Server?
View 1 Replies
Oct 19, 2009
I have been searching for days and months on youtube,google and everywhere else about how to create a Multi user chat system, where everybody can talk to each other all at once. Some people say Winsock is the way to go and others say TCP/IP is the way to go. I have little to no experience in either one of them. So if somebody can give me a really great turtioal or show me the guide lines on how to create a server and a client I would highly appreacite it. I am using Visual Basic 2008 express.
View 3 Replies
Feb 16, 2010
i have a multi-client/server app that needs to use a hashtable but i am getting an unexpected result because each timei call a sub from form1 the hashtable get recreated and erases all the data. [code]
View 12 Replies
Mar 21, 2010
Developing an application that will serve as an application server (Similar to 'Run Advertised Program' that is present in Windows Server). The downside to using Microsofts current system is that it a) requires Windows Server and b) Works only with systems setup in a proper Domain. I have a number of systems in my house and I'm fed up of downloading from the net or setting up network drives etc etc. I've tried using the code in a similar topic posted a few threads down, but it obviously doesn't support multiple client connections.
View 9 Replies
Feb 21, 2012
I want to make my client & server fully working. If a client connects to the server it should tell that there is a new client connected. if a client disconnects it should tell me a client disconnected.[code]it says in my patcher window(where it should add the text) that it's succesfully connected.but at the server side its not saying there is a new client connected/disconnected, how can I do this?
View 2 Replies
May 9, 2009
how to create a client/server... But I couldn't... I don't want anything fancy. Just want the client to send the server 4 numbers, depending on the user's choice; after that, the server would turn off the pc, restart it, etc. It all depends on the number received. Is there a rather "simple" way to do it? If it's not to much trouble you could use Atheist's example. (Btw I don't understand the code and, yes, I've checked on [URL])
View 9 Replies
Apr 25, 2012
I beleive I have asked a question similar in the past but I am re-visiting it with a slight difference and wonder if anyone can give advice.I am building a server app that when starts it opens a second 'listener' thread that when started will open up a listener on a port and wait. When a client connects it handles it and upon disconnects starts from the top and waits for the next client. Also once a client has connected its job is to look at a list of ports see what is free quickly respond with a port number setup another thread which then listens on the port number for the client.
At pretty much all times the 2nd thread will be stuck on a line waiting for a connection and at any one time there maybe more threads running waiting for a client to connect and if a client connects it never ends the thread as its stuck on a line of code.
Now currently if the service gets a request to stop it cannot stop the threads because they are just waiting on one line of code for a client to connect. I can easily set a varible to indicate the service is closing but they can only check that once a client is connected so the code is run.
What I either want is:
a) a way of force closing a thread from the main app thread or
b) a way for the line of code waiting for a client to connect to timeout after a certain amount of time.
View 7 Replies
Mar 29, 2010
I have a solution in VS 2008 that creates a DLL. I then use that DLL in another application. If I go in to the DLL projects property pages and change the following configuration for a DEBUG build then the built dll no long provides the desired functionality. If I change it back and rebuild the DLL, then the DLL does provide the correct functionality:
[Code]...
View 3 Replies
Jul 21, 2011
I'm trying to run a multi-threaded console app in VB and am having thread cross-over. Basically I want to run 5 threads, have them continually access a queue, process, and repeat until there's nothing left. When all threads have processed I want them to do something else.I'm attempting to use SyncLock to prevent multiple threads from accessing but it does not seem to be working.[code]
View 3 Replies
Jul 14, 2010
This is my attempt to create a ObservableCollection in VB that is WPF thread-safe. Can you think of any problems it may have?
[Code]...
View 2 Replies
Aug 10, 2011
I'm trying to teach myself how to create multi-threaded applications in Visual Basic Express 2008. I found a page headed "Creating Threads and Passing Data at Start Time" in the Library here -
[url]
However, I can't get any of the examples on that page to run. I pasted the code from an example into a new Project in my IDE but pressing F5 just gives me build errors which I have no idea how to resolve. It's probably something trivial but I can't progress with these examples. Please can somebody tell me what I need to add to get them to run
View 1 Replies
Apr 5, 2011
I am drawing five images in a row. The five are the same thing at five different zoom levels. Therefore, only one of the five will be displayed at any one time, but the others have to be there because there can be over 100 images being displayed on the screen at any one time, and each drawing is quite complicated. If I were to draw them all on the fly, then zooming would require that all 115 images be recreated and redrawn with each zoom. That's painful. To avoid that, I draw all five zoom levels of each image. When the user iteracts with the form, they will be interacting with, at most, two of the images, so when they interact with the form, only two of the 115 have to be redrawn, though those two have to have all five zoom levels drawn, for a total of 10 images.
[Code].....
View 14 Replies
Nov 11, 2010
I've just completed my first multi-threaded task under windows. Historically I am a VMS Engineer. You could multithread in drivers in VMS but VMS never had formalized threads. Which means it never had applications threads. Threads will become increasing important in the future. I thought this maybe a good time to discuss them. Not having access to sources hurts in terms of the amount of depth one can achieve in Windows. Some of the topics for this thread might be...compute resource regulation, how to do multi-threading and of course things to watch out for.
View 1 Replies
Mar 12, 2011
I have written a rather complex dll for processing a large volume of data (~4,000,000 records) from an Oracle database. It works well, but takes about 23 hours to run.Since I wrote the code fairly compartmentalized I realized that there are 6 routines that should be able to run concurrently, and I have a multi core processor,I decided to try my first multi-threaded implementation.
In the routine I am working on I am doing no I/O everything is in memory in variables. My data is already in dataTables and hashTables. Most of the data is defined as private in the class scope, but no conflicting updates should happen because the code segments works very distinct portions of the dataTables.The concept is simple, I have 2 routines that need to complete before launching my threads, and one routine that needs to run after all of the threads have completed. Here is what I am trying;
ProcessDXDate()
ProcessHistology()
aryThreads(0) = New Threading.Thread(AddressOf ProcessLaterality)[code].....
View 7 Replies
Oct 22, 2009
I'm using VB.NET. I want to build a large List (Of MyClassOrStructure) that becomes static after its initial population.I'm going to have multiple threads that need to iterate through this list to read data (no writing, inserting, or deleting)
Are there any very bad things that I need to keep an eye out for?
View 3 Replies
Feb 1, 2011
I am trying to create a proxy checker. This is my first attempt at multithreading and it's not going so well, the threads seem to be waiting for one to complete before initializing the next.
[Code]...
View 2 Replies
Aug 27, 2009
Raising events in multithreaded classes?
I am running a class(gamepad handler) that uses many child threads to check for key input and the like then it raises events to my form to sort out the needed reaction, Is there a way to make the event raises on the same thread as the class itself.
View 3 Replies
Jul 23, 2009
how to re-write my application (http:[url]....) to be multi-threaded using the background worker. The use case is something like:
1. User opens a binary file, it can be several Gbytes in size so reading it into memory isn't practical.
2. User can then navigate through the file in 188byte chunks, data is read from disk, decoded, and displayed for each chunk in turn.
3. User may want to search for some data or build a report. This will involve repeating the read, decode, display, function multiple times. During this looping the GUI stops responding and there is no option to cancel so I want to make it multi-threaded. So, is it safe to open the file in the GUI thread and then read from the file in the background thread? I currently use something like this to open the file once:
Dim fi As New FileInfo(filepath)
fs = fi.OpenRead()
and then in a separate sub multiple calls to:[code]..........
View 4 Replies
Mar 19, 2012
I've got a multi-threaded app - that is using a global COLLECTION of objects.I'm starting to think that objects - when copied to objects - are really just reference pointers to the "single object" in memory - as they would be in JAVASCRIPT (too many languages At any rate - this code - when taking the object from the collection to work with is it making a new object to play with or is it working the single object that actually resides in the collection?
[Code]...
View 16 Replies
Jul 25, 2009
I have an application with 4 threads. (GUI, Controller, Producer, Consumer) The GUI is self-explanatory. The controller starts the producer and consumer threads after some intial setup. The producer creates items and places them in a free slot in a "ring buffer". The consumer takes items from the "ring buffer" and writes them to disk. The producer creates items at a much higher rate than the consumer. The consumer is IO heavy and IO bound. Currently I am checking a variable in each ring buffer slot to determine if it can be written to.
if Slot.Free then
Write Slot.Data To Disk
end if
I am not using lock/synclock instead I'm just reading / writing the value of the slot's "free" variable. I don't believe that is correct even though it is a volatile read/write. Is there a better method to read/write this variable? The variable is of type "integer" and is either 0 or 1.
View 5 Replies
Oct 1, 2011
I've been writing multi-threaded applications for a couple of years and have started reading about the Task class. It looks like it handles mutex and synchronous/asynchronous threading in an easier to follow fashion. I was just wondering if you the community likes writing threads the old way or the 4.0 tasking applications. Lastly, I thought multi-threading was parallel computing. But I was reading that there are special task etc. parallel functions.
View 2 Replies
Aug 18, 2009
Im using the code from [URL] as a starter, most of the code is the same. the chat system works fine but on the client a added a disconnect button "clientSocket.Close()" and as soon as i click that i get errors, on the client, this is the code...
Private Sub getMessage()
For infiniteCounter = 1 To 2
[CODE]...
And this line...
serverStream.Read(inStream, 0, buffSize)
gives me "Unable to read data from the transport connection: A blocking operation was interrupted by a call to WSACancelBlockingCall."
Now im talking the server, after the client clicks disconnect or closes by task manager, looses connection, etc the server crashes and gives me.
View 5 Replies
Dec 4, 2009
I have a console application (VB.NET). When it is started, it spawns worker threads to find work in the database and do the task, then look for the next task (A workflow basically).
The problem that I have is that I have my Event Handler in the main thread that spawns the worker threads. Those workers, if they error, raise an event to a public delegate. However my main thread is not detecting these events, and I cannot figure out how to make it. My intention is to do all logging (text/database), email alerts, and restarting the worker to find another task that is not errored. (This will be expanded in the LogErrorMessage routine and such, for now I am just keeping it a simple Console.Writeline so that I can see if the method is being fired or not)
Here is the code around what I am trying to do:
Logger Class:
Public Delegate Sub LogDelegateError(ByVal Ex As Exception)
Public Class EventLogger
Public Event EventError As LogDelegateError
[Code].....
View 2 Replies
May 17, 2011
I am usng a multi threaded process to fire off a task, but when it is completed I want to make a label visible on the main form (form 1), eg "process completed", however the code I have in place comes up with the following error message;
Cross-thread operation not valid: Control 'lblCompleted' accessed from a thread other than the thread it was created on.
View 4 Replies
Feb 23, 2009
My application takes the currently logged-in user and uses an a DirectoryServices.DirectorySearcher to pull a few additional detail about them (some properties we have stored in a few custom AD fields, as well as their email address). This works great, though I've always though it was a little slow - my single-threaded code could only make about 2-3 requests/second to AD.
The real problem came when I moved this code to a web server. With multiple simultaneous users, the number of requests/second jumps greatly, and the LSASS.EXE process pegs on my server. I've checked the domain controllers, and they're just fine - the bottleneck is clearly on the application side. I suspect that what's slowing my down is the NTLM/Kerberos challenge/response, and the number of simultaneous requests pegs even the multi-core processor.
Our network policy doesn't allow anonymous reads from AD, so that choice is out. Also, I've tried every member of "AuthenticationTypes" (in the example, I'm using .FastBind), but they all seem to have about the same throughput rate with the same load on the processor.how I might work around this restriction and lower my demands on the processor? Here is the code I'm using - pretty straightforward:
Dim sPath As String = "LDAP://" & stringUserDN
Dim entry As New DirectoryEntry(sPath)
entry.AuthenticationType = AuthenticationTypes.FastBind[code]......
View 1 Replies
Jun 22, 2010
I have an Excel based algo-trading app that needs to take in lots of real-time data, and make trading decisions based on the calculations driven by the data. It is not one of those "read-only" stock ticker kinda spreadsheets.I created a COM object with VB.NET that runs in its own thread space which collects data from a socket, and when the data is read it raises an Event with data attached. In Excel VBA, the event handler parses the data, puts them to the right places on the spreadsheet to feed calculations (so far it sounds like a stock ticker app), and then, based on the results of the various calculations it does something.The problem is that when the user starts to click around the spreadsheet while there is large amount of data coming, the event handler's cell updating breaks apart. If the app is left alone without user action, it stands well. My frustration comes from not understanding what happens to the main thread when a user clicks around. Either the event handler blocks the user action, or the user action blocks the event handler (under which case I will put in some queuing facility). But I just don't see how user action can break the code (like causing VBA to stop executing)
View 9 Replies
Mar 5, 2009
I'm using the MAPI code by Dave Brooks.I am attempting to programatically send out a Crystal Report that is generated.When I run through the code without threading everything runs fine. The problem is when I use threading I get the return error "General MAPI failure [2]".I have never used threading before and understand that there are dangers involved. Can anyone provide any insight into this issue? NOTE: I've removed exception handling to make the code clearer.[code]
View 1 Replies
Jun 27, 2011
Hey guys, I am trying to send data from client to server (encrypted) and the string sent from the client is not the same as recieved from the server. I've been killing my brain for hours to get this to work but I cant manage. Im converting everything to Base64 string.
Client:
Public Sub SendMessage(ByVal msg As String)
Try
SyncLock myclient.GetStream
sw = New IO.StreamWriter(myclient.GetStream)
[code]....
View 4 Replies
Apr 6, 2012
Case : I'm creating an application (desktop application) with VB.NET (actually windows form), and using SQL Server Express 2008 for its database.
[Code]...
View 1 Replies