473,320 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

system.net.sockets connect issue

For anyone who is having this problem and want to know the
solution.

Add this line of code before your connect method call. It
loads up some config file that the code behind the scenes
needs that causes the delay when the config file is loaded
behind the scenes.

int temp = ServicePointManager.DefaultConnectionLimit;
-----Original Message-----
I am building a client server communications application,
and I need
to use sockets to provide the actual communications
channel. I have
coded the server and client, and from what I can see they
are both
working correctly.

I had to create an ActiveX user control was because the
client would
eventually be running in Internet Explorer from an object
tag on a
ASP.NET page. Then a decision was made to download
the .NET framework
to every client, so it was determined that this component
needed to be
recreated in .NET. That is when I came up with the class
library.

The ActiveX user control, which is using Winsock, works
correctly in a
VB 6 windows application and in an ASP.NET page. When I
run the .NET
client (it is a class library) from inside a .NET windows
application
everything works correctly, however, when I run it from
and ASP.NET
page, or even and HTML page almost everything works. WhenI try to
connect to the server is when I have problems. The first
time I
navigate to the page and the connect code executes; the
browser seems
to lock up for around 1-2 minutes. However, if I am
tracing the
server I see that the server accepts the connection and
returns
control back to the client as fast as the windows
application version.
So the delay occurs after the connection to the server
has already
been made. I have tried to recode this several ways and
they all give
the same result.

Here are the ways I have tried.

Inheriting from TcpClient, and executing Connect().
Instantiating an instance of TcpClient and executing
Connect() on that
instance.
Inheriting from Socket and executing Connect().
Instantiating an instance of Socket and executing Connect
() on that
instance.
Instantiating an instance of Socket and executing
BeginConnect() on
that instance.

I am just about out of ideas, if not completely out, so
any help would
be appreciated.

.

Jul 19 '05 #1
0 1768

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
2
by: mattymatmat | last post by:
I've been using sockets to try and connect to ranges of IP's on port 23. I'm trying to create a network discovery program for a specific program listening on port 23. I have no problem setting up...
4
by: BadOmen | last post by:
Hi, What is the different between 'System.Net.Sockets.Socket' and 'System.Net.Sockets.TcpClient'? When do I use System.Net.Sockets.TcpClient and System.Net.Sockets.Socket?? Yours, Jonas
2
by: http://www.visual-basic-data-mining.net/forum | last post by:
Say i have declare a module for connection and two buttons... one button has the method connect() and the other has the method disconnect().... how do i actually connect after i had disconnect...
2
by: Steve Bottoms | last post by:
Is there any way to pass a login name/password when calling System.Web.Mail.SMTPMail? Can't find anything in the docs or KB... If not, any suggestions to get this functionality short of building...
2
by: Stressed Out Developer | last post by:
We have an application that has a 200 count loop that does the following: ' Each time thru the loop we pass the next IP Address is a range (aka 192.168.4.50 thru 192.168.4.254) Try If...
0
by: Kevin Sage | last post by:
For anyone who is having this problem and want to know the solution. Add this line of code before your connect method call. It loads up some config file that the code behind the scenes needs...
8
by: JDavis | last post by:
I am using System.Net.Sockets to connect a client socket to a server that requires three inputs when I connect: host, port and an identification number that identifies the person connecting. ...
1
by: larspeter | last post by:
Hi all. I have a problem with TcpClient ... I am conneting to a server with TcpClient and returning the answer through a webservice. It actully all works fine. BUT if I make a lot of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.