|
Kogee San wrote: I just want to know is there any method or code which can connect a client programmed in C to a server which is programmed in C#
TCP/IP is TCP/IP, no matter what platform it runs on or what language the code is written in.
Why do you dismiss error codes? They can give you important clues to reasons for failure.
That's why they are there. Why not use the clues the system offers? Otherwise all you can do is guess.
Using the socket APIs properly will help...
First you need the port number in network byte order:
receiver.sin_port = <span style="font-weight: bold;">htons(5000)</span>;
Then you need to properly check for errors:
status = connect(sock, (struct sockaddr *)&receiver, sizeof(struct sockaddr));<br />
<br />
if (<span style="font-weight: bold;">SOCKET_ERROR</span> == status)<br />
{<br />
printf("Cannot connect to server, error no %d occured\n", ::WSAGetLastError() );
<br />
}<br />
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hello mark
Thanks for the reply. I just add the byte order method htons and it works. Thanks for the solution. I really2 appreciated it. Also thanks for the tips to take error messages seriously. I will take your advice. I know error messages is important for debugging, but i just consider a simple connection from client/server, thats why i dont want to concern the error messages. I will be careful next time. Thanks again.
|
|
|
|
|
plz how i can do tihs text""hello word tsdi" move with vb.net timer
thikns so mutch
|
|
|
|
|
Hi,
1.
have a Windows.Forms.Timer tick at the required frequency; in its Tick handler:
2.
modify the text you want to show, and cause a repaint.
say you are using a Label, just set the new string value in label.Text
say you are drawing the string yourself in a Panel's OnPaint method, call panel.Invalidate().
etc.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I created an Service and when i tried installing it to Services through dos I get the following error.
"No public installers with the RunInstallerAttribute.Yes attribute could be found..."
any ideas on sorting this out?
|
|
|
|
|
You don't have this:
[RunInstaller(true)] <--------------------
public partial class MyInstaller : Installer
and your installer class has to be public.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
thanks,
but i had both of those... anything else?
i followed the steps from ths msdn forums
|
|
|
|
|
Hi,
I have added an column to the typed dataset from .xsd file schema. But when i check it in the debug mode, I see that column field mapping for 2-3 has been mismatched.
What order do I need to add the field in to the .xsd schema file?
I possible can any body let me know the process to add an column in existing typed dataset?
Regards,
Vipul Mehta
|
|
|
|
|
I've written an assembly (.Net 2.0 DLL in C#) that streams a FLV video file to a flash player contained in the same program. Due to the nature of the FLV file, I have to load it in small chunks and pass the chunks in the stream one at a time. This works pretty well. However...
Under Vista (not SP1), as the file is streamed, memory consumption creeps up and up and up, and even after the stream has been closed, the memory consumption keeps increasing until the program itself is shutdown. Under XP, this does not happen at all. We have almost verified that the flash player is probably the culprit, but we don't know what to do about it.
We've tried streaming larger and smaller blocks of data, we've completely re-written the threading code twice, and we've tried several methods for actually streaming the data.
Can anyone offer any advice or pointers? Something to look for?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
How are you accurately checking memory usage?
Vista caches memory much different than previous operating systems.
Vista will happily use up all the RAM before dropping it for other processes to use.
Of course, there very well could be a bug in the player
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Well, it's not real scientific - we use Task Manager.
Yeah, I'm aware that Vista uses memory differently, but the behavior I've described starts to adversely affect the program's performance because eventually, Vista starts paging to disk to accommodate it's "caching" mechanism. On REALLY long videos (we're talking 1gb or more) the video develops a real bad stutter, and any system performance that escapes Vista's resource usage essentially disappears.
To read a block of the file at a time, I allocate an array of bytes before the loop, and I re-use that array until the operation is done. To make sure we didn't have a leak in the loop code, we simply stopped streaming what we were reading, and just let the loop load block after block of data. The memory use didn't go up at all at that point. This tells me that the problem is in the player. However, we don't have the source to the player itself. I think it's Adobe's component, but I'm not sure. I did the encryption and file streaming part of the app and haven't had to deal with "the other end" of things.
Is there a utility that will track memory usage better than Task Manager?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Is there a utility that will track memory usage better than Task Manager?
that's rhetoric I trust.
I usually have a timer (Windows.Forms.Timer) that periodically (1Hz) updates some numbers
in the GUI (a statusbar label); I look at:
Environment.WorkingSet for memory leaks,
GetGuiResources(processHandle, 0) for missing Dispose() calls on GDI objects,
etc.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
In addition to the other comments...
I don't think I have to tell you, that sounds like a memory leak bug to me.
If you've eliminated the possible causes in your code then it's the player.
You know that already
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
What version of Flash Player? There are issues with older versions.
|
|
|
|
|
I believe we even tried the latest one, and it still does it.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Have you profiled your app? It's useful to do this with a utility like CLR Profiler.
|
|
|
|
|
Have you tried using ProcessXP ^ by Sysinternals or Perfmon?
|
|
|
|
|
The CLR Profiler is incredibly useful for this. If the CLR GC itself is not continually allocating more and more memory, the problem is not your app - it's the FLV player, as you seem to already expect.
I'm curious why you're seeing that though. I don't seem to have that problem when I'm watching an FLV using FLV Player, for instance, or when I'm watching things in my browser. This is one of those things that I would absolutely not expect to see in a commercial, widely released, widely used product - simply because I'd expect the bugs to be solved long, long ago.
I wonder if there's not some sort of cleanup or clear function in the player you should be calling after every data pass.
Curious: Does the increase in memory consumption seem to match the amount of data you're sending to the player (decoded, of course)? That is, if you're sending it a 1KB chunk of FLV data, does the amount of decoded data correspond to the increase in memory usage by the OS?
It has become appallingly obvious that our technology has exceeded our humanity. - Albert Einstein
|
|
|
|
|
Hello,
I have a solution and it has 2 projects. When I try to open a project it says:
"The project type is not supported by the installation."
I have VS 2005 with framewotk 2.0
Any suggestions what might be wrong?
Regards,
Pavas
Regards,
Pavas
modified on Thursday, April 3, 2008 7:59 PM
|
|
|
|
|
Hi,
Maybe this will help.[^]
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Thanks.
If I have there are some custom controls installed and there are version difference in the framework like one project in 1.1 and other in 2.0..
Will this case Issue...
Regards,
Pavas
|
|
|
|
|
Yes, AFAIK all parts of an application should have the same .NET version: a single process
can not access parts of different framework versions.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Ok...but still Not able to find out what might be the cause
Regards,
Pavas
|
|
|
|
|
I have a program that was designed in Visual Studio 2005 and I had to modify the source code.
It was written with Visual Basic as the language and .Net
All I have is this VWD Express 2005. I need to do a build and to create an installer file. Is there a way to do this? What if I use Visual Basic and .Net?
Any way to use the VWD Express to do this?
Is there some third party solution?
Any advice would be greatly appreciated
Jeffrey A. Solochek
|
|
|
|
|
On startup I want to trigger the follow event manually to update whats displayed because the user has not selected anything in the combo box yet. So I want to make a default selection in the combo box if the Items member contains at least one item.
The code it executes only needs to be in this function, is calling it directly the best/only way to do this? Or is there another way to send trigger this message? Setting the SelectionIndex changes whats displayed in the combo box, but other things need to happen when that selection changes.
<br />
private: System::Void comboBoxList_SelectionChangeCommitted(System::Object^ sender, System::EventArgs^ e)<br />
{<br />
}<br />
|
|
|
|