|
Hi,
Strange behaviour with a System.Net.Sockets.Socket, reproducable on 95, 2000
and XP
If I reuse a socket object after initializing it I can reconnect without
problems.
But
If the application has been running for 23 minutes or longer, the socket
will forever
wait for BeginConnect() to finish.
If I use a Connect() (also after 23 minutes) instead of async connecting the call will block
forever.
I am using the following (pseudo) code to test. If running this after 23
minutes, the connect fails
and it is impossible to reconnect without restarting the application.
Is this known behaviour? Is there a workaround? Am I making a mistake? Help would be greatly
appreciated. For the time being I dropped a winsock control on a form and use that as my async socket.
regards
Guido
this is the offending code:
<br />
class SocketConnector<br />
{<br />
AsyncCallback m_callback = null;<br />
System.Net.Sockets.Socket m_socket = null;<br />
bool m_connected = false;<br />
public bool Connected<br />
{<br />
get { return m_connected; }<br />
}<br />
public void Connect(string ipaddress, int port)<br />
{<br />
m_callback = new AsyncCallback( OnConnect );<br />
<br />
m_socket = new Socket (AddressFamily.InterNetwork,SocketType.Stream <br />
,ProtocolType.Tcp );<br />
m_socket.Blocking = false;<br />
<br />
IPAddress ip = IPAddress.Parse (ipaddress);<br />
int iPortNo = System.Convert.ToInt16 ( port);<br />
<br />
IPEndPoint ipEnd = new IPEndPoint (ip,iPortNo);<br />
<br />
IAsyncResult ar = m_socket.BeginConnect( ipEnd, m_callback, m_socket );<br />
<br />
ar.AsyncWaitHandle.WaitOne(2000,false);<br />
<br />
if (!ar.IsCompleted || m_callback!=null)<br />
{<br />
m_connected = false;<br />
return;<br />
}<br />
m_connected = true;<br />
}<br />
void OnConnect(IAsyncResult result)<br />
{<br />
m_callback = null;<br />
}<br />
} <br />
<br />
|
|
|
|
|
What API can be used to extract data from MS Project with?
Thanks...
|
|
|
|
|
Hi All!
I use XmlSerializer to serialize object and got the following:
<?xml version=\"1.0\" encoding=\"utf-16\"?>
<MyClass xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://www.MyFirma.biz/MyNamespace\">
<Positions>
<Position>
</Position>
...
</Positions>
</MyClass>
Is it possible to get rid of the overhead (namespace info, schema info, xml version)? Anyway I do not need this info since parsing will be done without XmlSerializer.
So I need that output looks like below:
<MyClass>
<Positions>
<Position>
</Position>
...
</Positions>
</MyClass>
Thanks!
|
|
|
|
|
Hi,
how can I find Text with specific BackColor in my RTB and replace it with another BackColor ? I do not know the Text, Startposition, Length and number of the text pieces with the specific BackColor.
Thanks
Lupus
|
|
|
|
|
Sorry,
I put my question in the wrong section of this forum.
I'll repeat my question in the section "Visual Basic / VB.NET"
Lupus
|
|
|
|
|
What is difference between IL and MSIL in Dot.net FrameWork.
Regards
Rajesh
rajesh
|
|
|
|
|
As much as I know both are the same in dot net
where as IL is a more generic term Java Byte Code is an IL
any code that runs in some kind of a virtual environment is an IL
Regards,
Saqib Shakil
|
|
|
|
|
In the .NET Framework, IL is MSIL. It's Microsoft Intermediate Language.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
HI all,
I need some information regarding stack trace of the .net framework.
As we know,when ever an exception occurs some details will be shown in the stack trace.
In my project we have a system to lock the exact exception occured ..
using like this
Exception e;
e.InnerMessage;
I am using exception handling (try,catch,finally) in my development.
These details will be stored in some error log folder as files per each day.
My request is ...
1.)In which are the situations we will use stack trace related details in coding.
2.)Can i use the stack trace details for my project scenario more effectively than the existing system. If so pls give me details how can use that.
Thanks in advance,
Deepu
|
|
|
|
|
I have intalled .Net Framework 1.1 With SP1 on my test PC which is Running on Windows XP Home Edition and Windows 2000 Professional. My app crashes with some unknown Exception. I have tried a simple Windows App with just a few default controls it still doesnt work.
Error Shows
Common Language Runtime Debugging Services
Application Has Generated an exception that could not be handled
ProcessID = 0x128(288) ThreadID= 0x546(???)
What could be wrong with it
I have tried Both debug and release versions
Zishan Haider
|
|
|
|
|
You mention both XP and 2000 on your machine. Are you sure that the .NET framework is installed on the one you are using for the tests? If not, it will fail.
Another possibility is that the assembly is not running under the proper security credentials (e.g. running from a network drive without sufficient trust set for the intranet zone).
...Steve
|
|
|
|
|
The test systems did not have .net framework installed prevously. I installed it by running that 23MB framework file only. I even installed the SP1 after the framework installtion. And no.. The test system is isolated, i.e. not connected through any network. I am running it through the local hard drive. What else can be wrong?
Regards...
|
|
|
|
|
The framework is not correctly installed or you are targetting the wrong version of the framework in your assembly.
...Steve
|
|
|
|
|
I checked the framework version the test system has a has a .001 minor upgrade
and itt is supposed to be backwards compatible
but any how I will try to use the dotnetfx that comes with the VS2003 CD
will get back to you then
|
|
|
|
|
I'm using VC++ .NET, and I want to dinamicaly create a char * string.
I use the following code, but when I try to make the project, I have a error, exactly a link error not a build error!!!!!
char *c = new char [serialNumber->Length];
error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@$$FYAPAXI@Z)
Help me please!!!
Best regards.
|
|
|
|
|
Hi,
Please clarify which is more efficient.
using string.Empty or "". If so please explain why is this.
Iam often getting confused on this.
Thanks.
|
|
|
|
|
If you are that concerned about performance, you really shouldn't be writing code in .NET. It might take a few nanoseconds more to execute one or the other and unless you've identified this to be bottleneck, I'd suggest you go with the one you feel is intuitive and readable.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi,
i am suresh
ph: 9426772870
using string.empty inplace of "" is more efficient.
because it is .net's own function,
|
|
|
|
|
I want to run mono .NET on sun solaris. but there isn't an installation program on the mono's mainpage. How can i do it? and Can you give me some doucuments or references about how to run mono on solaris. Thanks!!!
|
|
|
|
|
Maybe try the "Superior" UNIX way of doing things *sigh*..
Download the source code, try to compile (auto make is always so easy to pick up in just a couple of year for any beginners), fix make/autoconf bug, then fix eventual platform dependant bug...
then.. that's it!
|
|
|
|
|
I have developed window application using VS2005 and .NET 2.0 on
Windows XP machine.
I have made setup project and deployed my application to Windows
2000,Windows XP and Windows 98 machine. (All installations are
fresh)
Application works well in Windows XP & 2000 but it is not
working in Windows 98.
There are two errors
1 Error)
Retrieving the COM Class Factory for componen with CLSID failed
with HRESULT: 0x8004015 (Class not registered
(REGDB_E_CLASSNOTREG))
System.Runtime.Interopservices.COMException
This error happens when I use System.Management.Objectsearcher
to read processor serial number using Select * from
Win32_Processor.
2 Error)
Logon Failed
Error in file
CrystalDecisions.CrystalReports.Enging.LogonException:Logon
failed. Unable to connect: incorrect log on parameters
System.Runtime.Interopservices.COMException
This error happens when I use Crystal Report and load it. I am
not usding db connection. I am using typed dataset so need of
dbconnection.
I have noted one thing comman in the both error is that
Exception is of System.Runtime.Interopservices.COMException..
so is there any problem in windows 98 when we use .net
namespaces which wrappers COM??
Some one please sort out my errors
Thanks
Nilesh
Nilesh Gambhava,
Life is NP-Complete so don't use Algorithm but use Heuristics
|
|
|
|
|
Nilesh Gambhava wrote:
with HRESULT: 0x8004015 (Class not registered
(REGDB_E_CLASSNOTREG))
System.Runtime.Interopservices.COMException
This means that your trying to use WMI on a machine that either doesn't have it or the installation is screwed up. This has nothing to do with the .NET Framework though.
Windows 98 doesn't come with WMI installed. Download the core components here[^].
Also, keep in mind that not everything in the .NET Framework is supported on Windows 98. No, there is no list spelling out what works and what doesn't.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
My application in vb.net calls its reports (CR) via the report viewer class. The report gets loaded but the time for calling the report is too much. Once in the cache it does not take much time. Is there anyway by which it is possible to load the reports faster? Thnx in advance for helping me out.
Bye TC
Nithya
|
|
|
|
|
Hello,
I'm thinking of writing a program that contains a messaging system like MSN Messenger, with all communication going via a server on the internet. I went looking for examples and I did found some. However, I don't know which technique I should use. A webservice would be nice for the serverside, since I wouldn't need a dedicated server or something like that to run a 'standard' server application. But I didn't manage to determine if a webservice will fit all my needs, like events (an event fired on the server must trigger a function on the client side).
The most important thing is a speak function, so that two (maybe even more) connected clients can talk with each other (not P2P but also via the server). I really don't know if I can realize that with a webservice. Maybe someone could point me in the right direction? Also, I don't know yet how to realize such a 'speak' function. I didn't find anything on that subject (I only read something about an embedded feature in DirectX9 for sending audio over the web, but I prefer not to use DX).
Any help is much appreciated!
Thank you very much in advance.
Joost
|
|
|
|
|
Hi
How can I add user defined words in Fxcop tool, I am adding the words in the CustomDirectory file but still Fxcop shows breaking message for the newly added words.
Regards,
kalyan
|
|
|
|