472,118 Members | 1,109 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,118 software developers and data experts.

Vb SMTP Server - Huge Problem. Please help

Hi

I am writing an SMTP server in VB.Net using the as Async
Socket Server Code in MSDN as the base. My problem is that
the port 25 socket Listener just stops accepting
connections after 10 to 20 secs.My listener loop is as
follows :

Public Shared Sub StartListening()
Dim localEndPoint As New IPEndPoint(ipAddress.Any, 25)

Dim f_oListener As New Socket(AddressFamily.InterNetwork,
SocketType.Stream, System.Net.Sockets.ProtocolType.Tcp)
Try
f_oListener.Bind(localEndPoint)
f_oListener.Listen(100)
allDone.Reset()
While g_oServer.MainLoopRunning
f_oListener.BeginAccept(New AsyncCallback(AddressOf
AcceptCallback), f_oListener)
allDone.WaitOne()
End While

f_oListener.Close()
f_oListener = Nothing
End Try
End Sub 'StartListening

Am I running out of threads from the thread pool ? If so
how can I control that value. My SMTP server gets a lot of
traffic.

The exact same code works perfectly in my POP Server

Thanks for any input

Ajay
Nov 20 '05 #1
2 1258
Hi Ajay,

Have you put any debug variables to count things?

This isn't my area but when I see something like New AsyncCallback inside a loop it gets the old "how many oif these at once?"
question ringing.

Might it be useful to those that know more about these things to show what allDone is?

Regards,
Fergus
Nov 20 '05 #2
Hi Fergus

Thanks for the suggestion. alldone is a ManualresetEvent

-Ajay
-----Original Message-----
Hi Ajay,

Have you put any debug variables to count things?

This isn't my area but when I see something like New AsyncCallback inside a loop it gets the old "how many oif
these at once?"question ringing.

Might it be useful to those that know more about these things to show what allDone is?
Regards,
Fergus
.

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Mike Obiku | last post: by
4 posts views Thread by Tushar | last post: by
6 posts views Thread by Daniel Walzenbach | last post: by
34 posts views Thread by antonyliu2002 | last post: by
7 posts views Thread by oopsbabies | last post: by
232 posts views Thread by robert maas, see http://tinyurl.com/uh3t | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.