Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Socket connection delay in asp.net

Reply
Thread Tools

Socket connection delay in asp.net

 
 
Paul
Guest
Posts: n/a
 
      11-18-2004
I'm trying to use a socket connection from within an asp.net
application.
It works, but somehow opening the socket seems to be extremely slow.
It finally connects and you can transfer information, but it hangs for
at least 5 seconds before the connection completes. Interestingly, a
second connection to the same port in a very short time interval (<1s)
returns instantly, but if you wait for a couple of seconds a new
connection again takes very long. The same code in a standalone .net
application does not show this problem, so it must be something with
asp.net.

This is a piece of code in C# that shows this behavour in an asp.net
application (supposed something is listening on the local computer at
port 7000)

Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp);
IPHostEntry ipHostInfo = Dns.Resolve("localhost");
IPAddress ipAddress = ipHostInfo.AddressList[0];
IPEndPoint ipe = new IPEndPoint(ipAddress,7000);
s.Connect(ipe);

Any help appreciated!

Paul
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Steve Holden Python 0 02-01-2009 12:45 PM
Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Laszlo Nagy Python 0 02-01-2009 07:37 AM
socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Laszlo Nagy Python 1 01-27-2009 05:05 PM
Re: socket.unbind or socket.unlisten? - socket.error: (48,'Address already in use') Jean-Paul Calderone Python 0 01-27-2009 01:41 PM
Delay in SSL socket connection? Rick Genter Java 2 11-09-2003 08:26 AM



Advertisments