C# - TCPClient Seems To Not Maintain A Keep-alive Connection?
Jul 5, 2010
I have the following code using the TcpClient
byte[] encbuff = System.Text.Encoding.UTF8.GetBytes("username" + ":" + "password");
string follow = "track=soccer,twitter";
byte[] encode_follow = System.Text.Encoding.UTF8.GetBytes(follow);
[code]...
View 1 Replies
Similar Messages:
Feb 3, 2011
I have created a webservice in 2010. And when I call it from my web application sometimes,It generates the follwoing errors:-1. The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.2. Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.I have already tried increasing excutonTimeOut etc.
View 2 Replies
Mar 8, 2011
string strURL = (Request.IsSecureConnection ? [URL] : [URL]
[code]....
I get an error on da line objPost.Close();.....the unusual error is that when I debug this code line by line slowly using F10 in visual studio 2010...the code works..but when I just run the program or even debug the program fast...it throws an error at that line.. it gives an error that the connection which was expected to be open was closed by the server..
View 1 Replies
Apr 28, 2010
How does .NET maintain the Connection Pooling internally?
Where it is stored for different kind of aplication(WebApplication,Console)?
Can we configure the IIS for Connection Pooling?
View 4 Replies
Feb 15, 2011
i tried to use external assembly in my web service method (Web service is worked in LAN). This external assembly in their own internals use TcpClient to access to external IP address. But unfortunally. Creation of TcpClient fails.
System.Net.Sockets.SocketException was caught
Message=A socket operation has encountered a dead network xxx.xxx.xxx.xxx:xxxx
Source=System
ErrorCode=10050
[code]...
View 1 Replies
Feb 23, 2010
A customer has asked that we do a dynamic whois lookup on the homepage of their ASP.NET site, based on the IP of the user accessing the site.The implementation would be something like what's described here:
http://www.aspheute.com/english/20000825.asp
However, I noticed that this code connects to whois.networksolutions.com. I am thinking that this may not scale very well if we are initiating a connection to this remote server on every page load.For example, say 1000 different users hit the home page - this would cause a lot of connections to be initiated.
View 3 Replies
Sep 13, 2010
I'm using Visual Studio 2008, and my database is SQL Server 2000.
I want to add a connection to the Server Explorer in VS. The Data source is Microsoft SQL Server (SqlClient). After entering in all my information and I click Test Connection, it is successful.
But when I click OK, I get the error:
Unable to add data connection. ExecuteScalar requires an open and available connection. The connection's current state is closed.
View 3 Replies
Apr 21, 2010
I have a web application running from 2 servers. I'm using 2 servers, because if 1 is not responding for any failure user can access the application from other server URL. Now I want to do the redirection automatically. That means, user will enter the URL of the primary server if it is not responding then it will automatically redirect to the other server URL. How can I do that using ASP.NET and C#?
View 5 Replies
Jan 18, 2011
i have a website where i want to keep the session alive while user has browser open?
View 9 Replies
Jan 21, 2010
I was wondering wich's the best way to "keep alive" the InputStream of the FileUpload Control.I would give you one example. Let's assume you have the FileUpload control in one WebForm, and you want process it in the next WebForm (after Response.Redirect).It would be great (unless for the memory) to have something similar to:
Session["PostedFile"] = this.FileUpload.PostedFile.InputStream.
Unfortunately, this results in:
System.ObjectDisposedException
View 2 Replies
Oct 5, 2010
This is quite straight forward. I'm calling a web-service (.asmx, with session enabled) from a c# application. I want each call to be with the same session key as the previous one (as opposed to creating a new session key each time).
Here's my (nothing-out-of-the-ordinary) code:
[Code].....
View 3 Replies
May 21, 2010
if updating a session value from within a webmethod call made from jquery would be able to keep my session alive?
JS:
$.ajax({
type: "POST",
url: "MyWebService.asmx/Keepalive",
async: true, [code]....
View 1 Replies
Nov 19, 2010
I have to keep a datacontext alive in a WCF service. This object is created on every call to the service, by the way decreasing performance. How could I keep this object alive with WCF.
View 2 Replies
Mar 23, 2010
I have a few web servers behind an Amazon EC2 load balancer. I'm using TCP balancing on port 80 (rather than HTTP balancing). I have a client polling a Web Service (running on all web servers) for new items every few seconds. However, the client seems to stay connected to one server and polls that same server each time. I've tried using ServicePointManager to disable KeepAlive, but that didn't change anything. The outgoing connection still had its "connection: keep-alive" HTTP header, and the server kept the TCP connection open. I've also tried adding an override of GetWebRequest to the proxy class created by VS, which inherits from SoapHttpClientProtocol, but I still see the keep-alive header.
If I kill the client's process and restart, it'll connect to a new server via the load balancer, but it'll continue polling that new server forever. Is there a way to force it to connect to a random server each time? I want the load from the one client to be spread across all of the web servers. The client is written in C# (as is the server) and uses a Web Reference (not a Service Reference), which points to the load balancer.
View 1 Replies
Feb 14, 2011
I gather customer information on a asp.net page (.net 2.0) then I want to open a new page / window which will be passed all the payment details and then connect to our payment service provide to process the payment. Once done the payment window is then close and the original calling window is updated with the result of the payment.
I can do all of the above, except I don't know how to go about opening a 2nd IE window leaving the calling windows on the screen whilst passing parameters and retrieving the result.
My best guess would be:-
Stuff all the parameters into session state var's
Open a new windows / page pickup the session state var's
Process the details
Write the results back to session state var's
Close the new window
Pickup the results from the session stae var's
View 3 Replies
May 14, 2012
I have used session in my application for admin panel. It is redirecting if i not use 1 or 2 minutes. I need to stay session until I click logout button.
View 1 Replies
Jan 27, 2011
I have a Authorizeclient.aspx.cs page where I set my session value.Authorizeclient.aspx is a blank page. HttpContext.Current.Session["nodeID"]="0". This session value changes from 0 or non zero which depends on the value returned by Database. If no value is returned I assign HttpContext.Current.Session["nodeID"]="0" as the default state else I assign HttpContext.Current.Session["nodeID"]=resolve(nodeID).ToString()
Till this part it works fine as expected. However, I have a requirement that I need to read the nodeID from Session in other application on the same server. I mean this application too is part of the root project where I initially created the Session and set it. The strange thing is the Session["nodeID"] in application gets null "SOMETIMES" Not always. I am trying to read the Session in Page_Load. Sometimes it works fine and sometimes it gets null. Moreover the session object do not die and I can see other keys like Session["Themes"] etc there. The session is in InProc mode and have 20 minutes timeout time.
View 6 Replies
Sep 13, 2010
I have a web app containing a silverlight application. How do I keep the ASP.NET session / Forms Authentication alive when the user is using the silverlight application?
View 1 Replies
Feb 1, 2011
I have a couple methods to handle the saving of an image using Request.InputStream. I have two extensions that share the HttpContext. In one of my methods, I'm using a BinaryReader to read in the contents and do the processing. However, naturally, when disposing the BinaryReader, it closes off the InputStream property on Request. My SECOND method uses the same input stream to create a thumbnail.
Bascially, I need a way to keep the Request.InputStream property alive after disposing the reader in the first method. Is this possible? Here are my two methods. SaveImageStream() is called first, then GenerateThumbnail().
[Code]....
View 2 Replies
Nov 23, 2010
I have a gridview and a detailsview in a page. when the "current record" (the cursor) is pacing along the gridview, the detailsview, which has the same datasource with the gridview, should keep the pace with the gridview.
View 1 Replies
Dec 29, 2010
how to set asp.net session alive no session timed out problem
View 11 Replies
Mar 15, 2011
just for my testing purpose i know i can define both the connection's outside in a single web config file by different name's and access them in my front end according to it but what if i want to have seprate for both connection's web.config situation is like this see image so i want to access my connections from second web config file how i can do that.
[Code]...
i tired this but its giving error
[Code]....
View 1 Replies
Jun 5, 2010
I previously used a datasource and a connection string to connect to my database on sql server and all orked fine. The connection string was saved in my web.config file and is: ....
View 1 Replies
Jul 23, 2010
I am using VS2008 and oracle 10g ODP.Net. The oracle database that I used in the connection is working and tested it using sql plus.The connection string when used in a GriDView works perfectly. Now when I created a new listview control with the same connection it gives an error.Database schema could not be retrieved for this connection. Please make sure connection settings are correct and the database is online
Object reference not set to an instance of an object at VSDataObjectSupport (478,6)
View 2 Replies
Apr 7, 2010
In my DAL i have more than 100 methods/Function, each and every method am opening the sqlconnection and closing the connection, this is taking too much of time to establish the connection at every time. So what i expect is one common class will create the SqlConnection that will check if the connection is Broken or Closed then create the connection again else return the connection, how to do this(Also i would like to apply ConnectionPooling).
View 7 Replies