By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,773 Members | 1,793 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,773 IT Pros & Developers. It's quick & easy.

Vb SMTP Server - Huge Problem. Please help

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.