High Speed Socket Communication In .NET?

Aug 9, 2009

I'm having some doubts on which communication protocol/platform would be better for my current development. The focus is on communication performance, and while reliability matters, I can handle a some packet loss. UDP sounds like the correct choice, but then the following question came up:

"What would be better, using a UDP socket directly in .NET, or using a UDP socket implemented in unmanaged C++ with a wrapper to .NET?"I'm quite sure that C++ is faster than .NET, and while the communication might be faster, I'm not sure if that performance improvement is not lost with all the C++-to-.NET wrapping?

Some info about the project I'll be using this on:

- The core of the project will be all made in VB.NET.

- There'll be a high packet sending/receiving volume (about 100-200/sec).

- There'll be many clients requesting data to the server.

- Network communication will be over a GB-LAN.

- Data is time sensitive, and some packet loss is accepted.

- Running on .NET 3.5.

View 3 Replies


ADVERTISEMENT

.net - High Speed Circular Buffer?

Jun 8, 2012

I have been asked to improve the memory efficiency of an application that is used for high speed data acquisition. After running the VS memory profiler several times and scanning the projects for obvious issues I came to the following conclusion: despite using a fixed size circular buffer for storing acquired sample points, the RAM usage increases relative to the polling period. For example: polling data for one signal at 2 microseconds can use 5 times more memory (private bytes) than when running at 50 microseconds ... even though the buffer size is the same.

The circular buffer is an array of SamplePoint objects. Each of these objects contains an array of Shorts (16 bit) for corresponding data per signal and one date object (8 bytes) for the time stamp. For efficiency, the circular buffer is Redimmed only once every time it begins polling and filled with empty sample points which are then "assigned".

Also, it seems that when we stop and run the application it hogs even more memory each time as though the Redim is not releasing the previous array. My questions boil down to the following: What is most memory efficient way of implementing a circular buffer containing managed objects which have arrays?Also, how and why is memory usage increasing with a fixed size array with different polling speeds? Does the garbage collector not have time? Do local variables get disposed of IMMEDIATELY when a sub or function exits?These are some of the doubts and concerns that I would like to rule out before proceeding.

[Code]...

View 1 Replies

VS 2008 Use Icyculyr's High Speed Syntax Coloring?

Aug 30, 2009

How would I use his code and get it to work with a RichTextBox when a button is clicked?

View 1 Replies

Socket.Close - TCP/IP ASCII Communication

Nov 24, 2011

I'm developing a VB.NET class that connects to one machine that has TCP/IP ASCII communication. I'll show the code and try to explain what is the problem:

CODE:

View 7 Replies

.net - Socket Communication - Unusual Data Being Received

Feb 24, 2011

I am trying to communicate to a local AS3 Air app on my PC via sockets. The VB.Net app is acting as a server in this case while the Air app is a client. The .Net app sends data every 25ms to the Air app. I have not send any message termination. I just receive the data on Air app and process it.

[Code]...

View 2 Replies

DB/Reporting :: Database Communication Speed Optimizations?

Mar 25, 2011

I have a few questions regarding database speed issues, I want to learn more on this subject. I searched the internet a bit but could not find an answer that satisfied enough me so I thought i try here. I have used adodb for quite a while but never were in the need of doing it the fastest way. That changed a bit.Is there information on the internet or can you provide me with information that illustrates what the cost is of doing a while not .eof loop to populate a dropdownlistbox with a lot of values or using a different approach? what are the faster approaches? I understand it depends on the situation but i am interested in a summary of some ball park figures. Just to illustrate what is better to use in certain situations.

View 2 Replies

VS 2010 - Speed: WebClient Versus Socket

Apr 25, 2012

I make a lot of programs that require an internet connection to download things from the web.At the very beginning, I used WebClient, as I didn't know Socket & how it worked.But now, I use Socket all the time, altough it's more lines of code. It seems to work faster then WebClient.I am interested if this is really true & why WebClient is slower (so is HttpWebRequest) then just a Socket.I've setup 2 threads which starts on the click of a button (WebClient thread starts first), the Socket beats the WebClient by just some milliseconds, but still.Each way has it's advantages & disadvantages, e.g.: if you use Socket, you need to write the header yourself & parse the response header.My question is, which one do you prefer & why ?Do you know why WebClient & HttpWebRequest are slower then Socket, as I assume, WebClient & HttpWebRequest both use tcp to download the things.

View 2 Replies

Identify Connection Lost Between Socket Server And Socket Client?

May 21, 2011

I wrote a Socket Client which will send the Socket Server some data and get some response from Server. This process will be running once in every 2 seconds.

Now what I need to know is How we can identify the connection lost between Server and Client?

I need this to be implemented in the Client side. If there is no connection then Client should automatically close the connection. Once the connection with the server is available in the next attempt it should connect automatically.

View 1 Replies

Check Internet Speed - Download A File Like 1mb Size, Then It Will Calculate The Speed?

Feb 21, 2012

How do i exactly check internet connection speed.I have searched around google and found out a method w/c will Download a file like 1mb size, then it will calculate the speed.

View 1 Replies

Check The Bandwidth (download Speed And Upload Speed) Of A User In .net Or Php?

Dec 31, 2010

how do i check the bandwidth (download speed and possible upload speed) of a user in vb.net or php that uses my app or visits my site resp?

View 1 Replies

VS 2010 Calculate DownLoad Speed And UpLoad Speed Kb/s And Graph

Nov 30, 2010

I have a codes that calculates DownLoad speed and UpLoad speed kb/s. I would like to implement this kind. I also want to put such kind of graph. Any article or links where can I start building my own like that.

View 2 Replies

Calculate Internet Download Speed And Upload Speed

Jul 29, 2009

i want to monitor the speed at which my system is currently Downloading and uploading. I dont have any idea how will it can be done.

View 6 Replies

Client Socket - Send Message Through Client Socket Receive Specified Argument Was Out Of Range Of Valid Values

Oct 15, 2011

Below is my code, but when i send the message thru client socket i receive Specified argument was out of the range of valid values. Parameter name: size

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim serverStream As NetworkStream = clientSocket.GetStream()
Dim outStream As Byte() = _
System.Text.Encoding.ASCII.GetBytes("0800822000000000000004000000000000000920092126012345001")

[CODE]...

View 1 Replies

Check For The Lan Speed And Put This Speed Value In A Progress Bar?

Jan 4, 2012

i want to check for the lan speed and put this speed value in a progress bar.

for example:

[==== ] the lan speed now is 23 KB/s

and there is another problem is if there are a LAN and a WiFi adapter in the same time how do i check for the speed for both adapters

View 1 Replies

Get The Speed Of A Computers Fan Speed?

May 5, 2009

how would i go about getting the of a fan of a computer that my program is running on in rps(revolutions per second) using vb.net?

View 4 Replies

High-Performance TLS With .NET?

Sep 6, 2010

I'm working on a project that calls for high-performance networking with TLS encryption in VB.NET. The stock SSLStream sucks rotten eggs; its 'asynchronous' read/write operations aren't async at all, meaning that they'll operate parallel to each other and to the main thread but that it offers absolutely nothing that resembles async read/read and write/write, which means that reads are totally synchronous to each other and writes are too (only 1 read and only 1 write can be done at a time).

I've done a lot of reading on this failing and it seems like MS has no intention of ever fixing this.Hoping a whole lot not to have to write my own TLS implementation. I've tried the Mentalis open source SSL suite, which will NOT compile. I've tried SocketWrench tools which will not compile under VS 2010 (and whose documentation indicates it's in fact synchronous on its async threads too; can only do 1 async read and 1 async write at a time).

What I want/need is an SSL/TLS implementation that actually works with DotNET that actually allows me to do multiple asynch reads/writes over a TCP/IP transport stream. Anybody have any experience or recommendations on 3rd party toolkits or alternate methods of SSLStream I/O?

View 1 Replies

Calculate New High Score?

Apr 27, 2009

I need to calculate the high score and am having trouble storing a value that represents the previous high score, and the comparator funcion.

Public n_sErrorTitle As String = "Entry Error"
'Count the number of entered scores
Dim intCount As Integer

[code]....

View 3 Replies

Execution Time Too High?

Aug 15, 2011

PFB the code for a search button where when a user enters a text in the text box ,it takes the keyword compares it with an xls which has 1600 rows and 16 columns with keywords.If the keywords match, it has to full the 3rd column where the name is specified.Its running but its taking more than 20-25 mins for processing.I knw searching 1600 rows and 16 columns will take time but pls advice if i can make this process a lil faster.

[Code]...

View 13 Replies

Making A High Score?

Apr 1, 2010

how can i save a high score in toolstrip textbox or listbox?

View 7 Replies

Teach VB High School?

Jan 22, 2006

Where can I find some books that might be used at the High School level to teach students programming using Visual Basic from the ground up, assuming no knowledge of programming?

View 5 Replies

VS 2008 High And Low Levels

Dec 15, 2009

whats the difference with high and low level of programming

View 1 Replies

VS 2008 Progressbar Value Going To High

Jul 12, 2009

I made a game and i made a hp bar.So i made a Heal button but when the value is more then the Maximum value it crash.Any way to fix that? Like something to bypass that go go back to the Maximum Value?

View 7 Replies

Create A High Scores Board?

Aug 20, 2011

I am trying to create a high scores board - currently i was experimenting with just typing a number into a textbox and having it automatically order the numbers (in labels) from largest to smallest however i cannot get them all to work. either just the first and second (label) works or the second and third display the same number or the second decreases in value even though it shouldn't[code]...

View 7 Replies

Find The High And Low Numbers From 5 Different Textboxes?

Oct 28, 2010

I have two functions to find the high and low numbers from 5 different textboxes. I want the high in one label (which I have) an the low in another. I cannot seem to get the low number to be anything other than 0. Here is the code:

[Code]...

View 6 Replies

Save A High Quality Jpeg?

Sep 2, 2011

I want to make a wallpaper changer because windows high compresses the the image so you see artifacts even if already use a jpeg or even a really high quality png or bmp.

I know what I need to do for all of it I just need to know how to save an image to a jpeg without it being compressed. I have tried using the encoderparamters and getcodecinfo aswell as setting the quality to 100 but I still get a really bad looking image in the end.

Is there a way where I can save an image to a jpeg without getting the crappy image quality like with visual basic?

View 7 Replies

Spikes Appear Using DrawEllipse When Pen Thickness Goes High

Oct 21, 2011

I have a graphics program and in it I use DrawEllipse plenty and when the pen thickness gets high like around 12 pixels or above you start to see these spikes. I'm using a PictureBox so double buffering is being used. Is there anything I can do to get rid of the "spikes". In the screenshot at top the pen thickness is at 19 and is 28 in the lower.

View 10 Replies

Storing High Scores Online

May 6, 2012

I'm working on a video game in VB .NET and I was wondering if there is any way to store its high scores online.If there is any way to do this, that would be great, but otherwise, I'd like to know what would be the best method of locally storing high scores on a single computer.

View 1 Replies

TCP Client In High Volume Application?

Jan 16, 2012

I have several services that use UDP messages to send out XML status information which is displayed in an application with a UDP listener. This works well. Some of our services are installed at a different site. The UDP messaging does not cross over the routers. Therefore, I wrote a TCP-UDP forwarder service that listens for the UDP messages at the remote site, then forwards them via TCP to a partner service in our local office. That partner service then re-sends the messages via UDP so we may monitor them.

My problem is that the method that sends the messages via TCP appears to be dropping a lot of the XML messages. When the service gets a UDP message, it enqueues it in a queue object for processing. The enqueue statement is enclosed in a synclock object. A separate thread dequeues the message using the same synclock object and sends it via TCP. Originally, I had the code written so that the TCP Send method instantiates the TCPClient, opens it, does a GetSteam, sends the message with a BinaryWriter, closes the writer, closes the stream, closes the client.

Next, I updated the code to declare the TCPClient at the module level. The send method checked to see if the TCPClient variable was nothing and, if it was nothing, instantiated it and connected it. If it was already instantiated, I just tried to re-use it. I close the TCPClient when the service runs the OnStop method. This way did not work. I get "The operation is not allowed on non-connected sockets." errors.

What is the best strategy for implementing a TCP sender that works in a high volume environment. I only have four services sending UDP messages that need to be forwarded at this time. I eventually will have many more.

View 4 Replies

Transfer High Files From 1 Pc To Other Using LAN / Internet?

Jun 16, 2012

I am trying to make file transfer program in vb.net 2008 for big files eg. 10 GB.i was able to code simple socket program to transfer files with small size by using Sockets but if the file is large then "File.ReadAllBytes(ComboBox1.Text)" command will not work cause it use lot of memory & if the file is really big i.e. 10 GB it give not enough memory error, so i made a loop that sends data in small amounts, but this give me a larger file size with repeated data at end of the file.

[code]...

View 7 Replies

Windows Service Adn High CPU Usage?

Nov 2, 2010

I am working on a windows service and I am looking for a better solution to an issue with high CPU usage. The service needs to only 'run' every minute or two to gather some db data and do some light processing. Right now I have it running in a separate thread in the service application using the BackgroundWorker. In that thread, I do a Thread.Sleep(30000) after each db iteration. This has taken care of the CPU issue (obvious) but I am let thinking there is a better way. This works fine, I can still cancel the service without issue etc. however it feels wrong. Blocking that thread seems bad.

That being said, what is the best way to actually do this? I don't want the loop to just constantly run, I only want it to do work on a somewhat regular time frame. Would running this in a timer_elapsed event handler be a better way?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved