Slow Serial connection.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am using Kernel32 functions to communicate to the serial port in C#
program. But it takes much longer compare to VC++ 6.0. I am talking about 8
sec longer which is not acceptable for me. Any ideas? Thanks.
 
Tony,

Are you marshaling large amounts of data between the kernel32 functions
and the unmanaged realm? For example, are you passing large byte arrays
that are written to/read from? Those byte arrays can be costly to marshal,
depending on the size.

How else are you using the code?
 
Nicholas,
around 952 bytes but couple times. Is that too much? I just have the file in
the project where I use the dllimport for kernel32.dll and simple functions
write and read. I am using this calls from other file.
Can I read more about it somewhere? In VC++ 6.0 it took 1 seconds, now it is
8.
Thanks.

Nicholas Paldino said:
Tony,

Are you marshaling large amounts of data between the kernel32 functions
and the unmanaged realm? For example, are you passing large byte arrays
that are written to/read from? Those byte arrays can be costly to marshal,
depending on the size.

How else are you using the code?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Tony said:
Hi,
I am using Kernel32 functions to communicate to the serial port in C#
program. But it takes much longer compare to VC++ 6.0. I am talking about
8
sec longer which is not acceptable for me. Any ideas? Thanks.
 
Back
Top