|
Gareth H wrote: and then call tcpClient.Close();
No way to say this doesn't get people upset but, developing quality software can ONLY be accomplished by reading the documentation, period.
link[^]
When you are finished sending and receiving data, use the Shutdown method to disable the Socket. After calling Shutdown, call the Close method to release all resources associated with the Socket.
Gareth H wrote: I am a bit confused as to why this error is being thrown, since when I close the form, the "Reading..." trace is never printed out.
I can't explain how your code works. A wild guess is that it did print out long before you closed anything and you just are not seeing it because you are mistakenly expecting to see it print out when you close the form. That said, an exception will be thrown from a blocking read when the read is canceled. That behavior is by design.
led mike
|
|
|
|
|
I added the Shutdown call, but that didn't solve the problem. It seems that the exception is thrown the same number of times a message is sent to the java process. So, if I send 5 messages, 5 exceptions are thrown when the form is closed.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Gareth H wrote: I added the Shutdown call, but that didn't solve the problem.
Did you read my post?
led mike wrote: That said, an exception will be thrown from a blocking read when the read is canceled. That behavior is by design.
Gareth H wrote: It seems that the exception is thrown the same number of times a message is sent to the java process.
Without being able to reproduce the behavior themselves it is unlikely anyone will be able to help you. I have done socket development since 1994 and I have never seen anything such as you describe. My first guess is that the behavior is introduced by your code, not by the TCP stack or the any of the other libraries you are using.
Some of what you previously said indicates you are using threads. It is very likely you are creating a new reading thread for each message sent to the Java process since that would explain the behavior.
led mike
|
|
|
|
|
I solved the problem. Changed my Read() method to create a StreamReader in a using block.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
I need to capture the SessionEnding event in my C# app, this worked fine by adding a handler to the SystemEvents.SessionEnding event when I had message loop on my main thread. Unfortunately that is now not the case, I no longer have a message loop and now I don't get the notification.
I have tried creating a message-only window to capture the WM_ENDSESSION/WM_QUERYENDSESSION messages but these are only sent to top-level windows and not message-only windows. So I tried using SetWindowsHookEx to hook WH_CALLWNDPROC which still does not send the WM_ENDSESSION message, then I tried SetConsoleCtrlHandler which also doesn't seem to work.
Does anyone have any ideas on how I can trap this message without a main form?
Thanks.
|
|
|
|
|
Replaces "[fieldname]" in the HTML template document with data from the corresponding column of the SQLite table
|
|
|
|
|
What you are saying is not a question. I don't understand what you are trying to do.
Simon
|
|
|
|
|
Don't care.
He's just getting on everyone's nerves, posting the same crap again and again.
He's trying to find some idiot who will do his work.
Regards
Thomas
www.thomas-weller.de
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Programmer - an organism that turns coffee into software.
|
|
|
|
|
Use VS 2005.NET
Create Windows Form Application
|
|
|
|
|
The more times you post the same post the less chance you have to get an answer especially when what you are posting is homework.
|
|
|
|
|
Uhhh What do you really mean ?
Explain your problem
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Stop cross posting your homework everywhere.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
|
|
1) Use a descriptive title
2) Ask a question.
edit: 3) Dont repost the same rubbish as thread below
|
|
|
|
|
I need to know what is the major difference between "Infragestic 2007 volume 2" and "Infragestic 2008 volume 1" if anyone has the documentation pls send it to my mail ID : vinayskvs@rediffmail.com
or send me if any related links that can help me to know the difference in there features pls let me know...
thanks in advance.
|
|
|
|
|
The best place to find out would be on the infragistics[^] web site.
If they don't have the info on the site, email support, or try asking in their forums.
Simon
|
|
|
|
|
thanks stevens, i ll try to ask in their
Simon Stevens wrote: forums
only..
|
|
|
|
|
how to insert data from database into a table which is placed in word document.
Please help me reagrding this.i am not getting solution.
|
|
|
|
|
You can use word object model for working with word files.
|
|
|
|
|
i didnt get you.can you explain some more clearly.
actually my problem is to insert data into table it has to recognise table starting and ending.how will it recognise starting and ending of table.
|
|
|
|
|
sram15 wrote: i didnt get you.can you explain some more clearly.
Google can: word object model[^]
|
|
|
|
|
I want to run program on background . pref C#
I want put icon in the tray.
On specified time it’s synchronizes folders (I know how to sync folders) .
How to run it on background and start sync ( for example at 2am)?
|
|
|
|
|
Use NotifyIcon if you want to show icon in system tray. To run the form in background Hide() it either in Load or Shown event.
You can use windows scheduler to schedule when your application runs. Here is a library for working with windows scheduler: A New Task Scheduler Class Library for .NET[^]
|
|
|
|
|
Hi,
Iam getting HTML code from one of my webpage,i have to use that in another page but before that i have to remove some components and take only one table from that page.Is it possible to do this?any sample pgm for this?
|
|
|
|