Click here to Skip to main content
15,922,407 members
Home / Discussions / C#
   

C#

 
GeneralRe: Clear textbox problem --> And this works Pin
Gareth H25-Feb-08 6:46
Gareth H25-Feb-08 6:46 
GeneralRe: Clear textbox problem Pin
engsrini25-Feb-08 11:47
engsrini25-Feb-08 11:47 
QuestionProcess memory, significant addresses Pin
Jitse25-Feb-08 4:33
Jitse25-Feb-08 4:33 
GeneralRe: Process memory, significant addresses Pin
Luc Pattyn25-Feb-08 4:48
sitebuilderLuc Pattyn25-Feb-08 4:48 
GeneralRe: Process memory, significant addresses Pin
Jitse25-Feb-08 5:02
Jitse25-Feb-08 5:02 
GeneralRe: Process memory, significant addresses Pin
Luc Pattyn25-Feb-08 5:28
sitebuilderLuc Pattyn25-Feb-08 5:28 
GeneralRe: Process memory, significant addresses Pin
Jitse25-Feb-08 5:43
Jitse25-Feb-08 5:43 
GeneralC# Windows Service shutting down Pin
Saamir25-Feb-08 4:04
Saamir25-Feb-08 4:04 
Hi Guys,
I need some help please. I have the following code being called in my timer_elapsed function and my timer is being enabled in the onstart of the windows service. This worked fine with .net 1.1 but ever since I have converted the application to .net 2.0, my service shuts down without notice when there is trafic in client requests i.e. ProcessClientRequest call. When I try to restart the service upon shut down it gives me an error saying "Only one usage of each socket address (protocol/network address/port) is normally permitted"
So I have to stop and wait a few and restart and it works fine and then again when there is much activity in processclientrequest call it shuts down.

I know this is not much information but please help me if you have any ideas.

Writ2ErrLog("Service Timer Initialized");
string sErr = "Application is ready for processing";
try
{
Writ2ErrLog(sErr);
m_tMonitor = new TD.Timer(new TD.TimerCallback(MonitorFunc), 1, 0, 45000);//45 sec

if (m_sServerAddr == string.Empty)
{
m_sServerAddr = Dns.GetHostName();
}
if (m_nPort == -1)
{
m_nPort = 1024;
}

IPHostEntry hostEntry = Dns.GetHostEntry(m_sServerAddr);
IPAddress ipAddress = hostEntry.AddressList[0];
IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, m_nPort);
m_svSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
m_svSocket.Bind(ipEndPoint);
m_svSocket.Listen(10);

while (true)
{
try
{
Socket rtSocket = m_svSocket.Accept();
if (rtSocket.Connected)
{
TD.WaitCallback myCallBack = new TD.WaitCallback(ProcessClientRequest);
TD.ThreadPool.QueueUserWorkItem(myCallBack, rtSocket);
}
}
catch (Exception ex)
{
Writ2ErrLog(ex.Message);
break;
}
}
}
catch (Exception ex)
{
m_svSocket.Close();
m_tMonitor.Dispose();
sErr = "Start Error " + ex.Message;
}
finally
{
if (sErr != string.Empty)
{
Debug.WriteLine(sErr);
Writ2ErrLog(sErr);
}
}

Sameer

GeneralRead Outlook express - 6 contacts using c# 2005 Pin
Member 4463561 @##$#%$#%*(*&^(&)(_++[25-Feb-08 4:02
Member 4463561 @##$#%$#%*(*&^(&)(_++[25-Feb-08 4:02 
GeneralRe: Read Outlook express - 6 contacts using c# 2005 Pin
Judah Gabriel Himango25-Feb-08 5:54
sponsorJudah Gabriel Himango25-Feb-08 5:54 
GeneralRun time error Pin
Mc_Topaz25-Feb-08 3:57
Mc_Topaz25-Feb-08 3:57 
GeneralRe: Run time error Pin
Judah Gabriel Himango25-Feb-08 5:48
sponsorJudah Gabriel Himango25-Feb-08 5:48 
GeneralRe: Run time error [modified] Pin
Mc_Topaz25-Feb-08 20:23
Mc_Topaz25-Feb-08 20:23 
GeneralRe: Run time error Pin
Judah Gabriel Himango26-Feb-08 6:33
sponsorJudah Gabriel Himango26-Feb-08 6:33 
GeneralRe: Run time error Pin
Gareth H25-Feb-08 6:54
Gareth H25-Feb-08 6:54 
Question[Datagrid] How to disable row selection when Button from ButtonColumn is selected [modified] Pin
Soulhalo25-Feb-08 3:51
Soulhalo25-Feb-08 3:51 
QuestionPop3 Protocol Pin
Sunshine Always25-Feb-08 3:12
Sunshine Always25-Feb-08 3:12 
GeneralRe: Pop3 Protocol Pin
DaveyM6925-Feb-08 3:34
professionalDaveyM6925-Feb-08 3:34 
Generalround Pin
arkiboys25-Feb-08 2:09
arkiboys25-Feb-08 2:09 
GeneralRe: round Pin
DaveyM6925-Feb-08 2:14
professionalDaveyM6925-Feb-08 2:14 
GeneralRe: round Pin
Guffa25-Feb-08 2:34
Guffa25-Feb-08 2:34 
GeneralHelp regarding multiline textbox Pin
i_want_to_learn_c#25-Feb-08 2:00
i_want_to_learn_c#25-Feb-08 2:00 
GeneralRe: Help regarding multiline textbox [modified] Pin
DaveyM6925-Feb-08 2:10
professionalDaveyM6925-Feb-08 2:10 
GeneralRe: Help regarding multiline textbox Pin
Luc Pattyn25-Feb-08 4:55
sitebuilderLuc Pattyn25-Feb-08 4:55 
GeneralRe: Help regarding multiline textbox Pin
i_want_to_learn_c#26-Feb-08 0:37
i_want_to_learn_c#26-Feb-08 0:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.