473,657 Members | 2,409 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

system.net.sock ets 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 = ServicePointMan ager.DefaultCon nectionLimit;
-----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().
Instantiatin g an instance of TcpClient and executing
Connect() on that
instance.
Inheriting from Socket and executing Connect().
Instantiatin g an instance of Socket and executing Connect
() on that
instance.
Instantiatin g 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 1796

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

Similar topics

9
4950
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 webserver runs that part of the script (see attached file, snippet.php), though, it doesn't go through. I don't get an error message or anything...it just returns a "1" (whereas it should return a "0") as far as I can tell. I have read the PHP...
2
1918
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 the socket and making the connection, my problem happens when I try and make a connection to an IP with no machine. It takes a little longer then I would like it to before it throws an exception. I've noticed that during this period all its...
4
6313
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
13528
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 my tcpC... I could not connect after i disconnect my connection... Imports System.Net.Sockets
2
7543
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 something straight from sockets? Third party component isn't an option... :) Thanks! Jack
2
2349
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 mUIO_Threads(i) Is Nothing Then mUIO_Threads(i) = New System.Threading.Thread(AddressOf mUIO_DAQ(i).InitDAQ) mUIO_Threads(i).Name = mUIO_DAQ(i).UIO_IPAddr mUIO_Threads(i).IsBackground = False
0
882
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 that causes the delay when the config file is loaded behind the scenes. int temp = ServicePointManager.DefaultConnectionLimit;
8
2178
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. None of the overloads for either the Connect or BeginConnect methods takes that many inputs (basically they take host and port only). Would it be best to create a new class that derives from the base class System.Net.Sockets and implement a new...
1
4455
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 (re)connection (hitting the submit button) then I start to recieve a an error: IOException:System.IO.IOException: Der kunne ikke læses data fra transportforbindelsen (LPF: could not read data from the transport
0
8395
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8826
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6166
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.