Click here to Skip to main content
15,888,521 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
Questiona bug in loading tiff 16bit images? Pin
anurik15-Dec-04 1:38
anurik15-Dec-04 1:38 
Generalwindow border size Pin
anurik14-Dec-04 23:55
anurik14-Dec-04 23:55 
GeneralRe: window border size Pin
Mathew Hall15-Dec-04 1:24
Mathew Hall15-Dec-04 1:24 
GeneralRe: window border size Pin
anurik15-Dec-04 2:37
anurik15-Dec-04 2:37 
GeneralRe: window border size Pin
benjymous15-Dec-04 5:56
benjymous15-Dec-04 5:56 
GeneralRe: window border size Pin
anurik15-Dec-04 22:54
anurik15-Dec-04 22:54 
GeneralRe: window border size Pin
Mathew Hall16-Dec-04 22:05
Mathew Hall16-Dec-04 22:05 
GeneralTime out with HttpWebRequest Pin
Manjunath N.A14-Dec-04 23:20
Manjunath N.A14-Dec-04 23:20 
Hi,
I have a Library DLL that is used by a .NET Web application (running in Windows 2003 server). The DLL / Library will try to send some data to two web application (ASP running on windows 2000 server) running on two different servers.

If the any of the Windows 2000 server is down the .Net Web application fails to complete the request. It is understood that it should fail for the server which is down, but it also fails for the other server as well. And this does not fail always it fails only some times.

The DLL is written in C#. The function that sends the webrequest creates a HttpWebRequest object using the WebRequest.Create method

and times out for the method call for HttpWebRequest.getResponse().

I am not setting the no-cache to the headers and also not setting proxy properties.

Please the function that is being used for this

HttpWebRequest HttpWReq;
HttpWebResponse HttpWResp = null;
StreamReader receiveStream = null;
Stream readStream = null;
int result =0;
try
{
Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
HttpWReq =
(HttpWebRequest)WebRequest.Create("http://" + ip._ipAddress + ":" + ip._port + "/iPackagerweb/Upload.asp");
HttpWReq.KeepAlive = false;
HttpWReq.Timeout = _iPackTimeout;
String postData;// = "ID#~" + screenID;
if(screenID.Equals("shutdown"))
{
postData = "ID#~" + "update_" + screenID;
postData += "&~Update#~1" + "&~Data#~" + data;
}
else
{
postData = "ID#~" + screenID;
postData += "&~Update#~0" + "&~Data#~" + data;
}
HttpWReq.Method = "POST";
HttpWReq.ContentType="application/x-www-form-urlencoded";

HttpWReq.ContentType="multipart/form-data";
HttpWReq.ContentLength = postData.Length;
//ASCIIEncoding asciiEncoding = new ASCIIEncoding();
Stream data2Send = HttpWReq.GetRequestStream();
byte[] postByteData = encode.GetBytes(postData);
data2Send.Write(postByteData, 0, postData.Length);
data2Send.Close();
HttpWResp = (HttpWebResponse)HttpWReq.GetResponse();
readStream = HttpWResp.GetResponseStream();

receiveStream = new StreamReader(readStream, encode, false);

if(receiveStream != null)
{
Char [] strResp = new Char[255];
String resultMessage = "";

int count = receiveStream.Read(strResp, 0, 255);
while(count > 0)
{
resultMessage += new String(strResp, 0, count);
count = receiveStream.Read(strResp, 0, 255);
}
if(resultMessage != null || resultMessage.Length == 0)
{
;
}
else
{

HttpWResp.Close();
HttpWResp = null;
receiveStream.Close();
receiveStream = null;
readStream.Close();
readStream = null;
result = 3;
errMessage[0] = resultMessage;
return result;
}
receiveStream.Close();
receiveStream = null;
}
else
{
HttpWResp.Close();
HttpWResp = null;

result = 3;
return result;
}
HttpWResp.Close();
HttpWResp = null;
return result;
}
catch(WebException we)
{
//Logging exception here and found out to be timeout exception
}
catch(Exception e)
{
//Logging the exception here as well, does not come here
}
if(HttpWResp != null)
{
HttpWResp.Close();
HttpWResp =null;
}
if(receiveStream != null)
{
receiveStream.Close();
receiveStream = null;
}
if(readStream != null)
{
readStream.Close();
readStream = null;
}
return result;

Any help on this would be of great help. I have time till Dec 16 (Thrusday after noon Sydney time)

Thanks in advance

GeneralIE Hosting problem Pin
Ryszard Krakowiak14-Dec-04 20:58
Ryszard Krakowiak14-Dec-04 20:58 
QuestionWhich registry values are updated when Windows XP Service Pack (1/2) is installed? Pin
mmsspp14-Dec-04 19:40
mmsspp14-Dec-04 19:40 
AnswerRe: Which registry values are updated when Windows XP Service Pack (1/2) is installed? Pin
Mike Dimmick17-Dec-04 13:19
Mike Dimmick17-Dec-04 13:19 
GeneralConsole Application Pin
har04mich14-Dec-04 11:19
har04mich14-Dec-04 11:19 
GeneralRe: Console Application Pin
Mike Dimmick17-Dec-04 13:27
Mike Dimmick17-Dec-04 13:27 
Generalfile processing time Pin
shaw12314-Dec-04 8:50
shaw12314-Dec-04 8:50 
GeneralRe: file processing time Pin
Mike Dimmick17-Dec-04 13:58
Mike Dimmick17-Dec-04 13:58 
GeneralIs it possible: start .Net executable by GUID Pin
nielsvdc14-Dec-04 4:40
nielsvdc14-Dec-04 4:40 
GeneralRe: Is it possible: start .Net executable by GUID Pin
devvvy14-Dec-04 5:53
devvvy14-Dec-04 5:53 
GeneralRe: Is it possible: start .Net executable by GUID Pin
nielsvdc14-Dec-04 10:10
nielsvdc14-Dec-04 10:10 
Generalexception in switching between panels Pin
Vinsent13-Dec-04 22:46
Vinsent13-Dec-04 22:46 
GeneralRe: exception in switching between panels Pin
The Man from U.N.C.L.E.14-Dec-04 4:35
The Man from U.N.C.L.E.14-Dec-04 4:35 
GeneralRe: exception in switching between panels Pin
Vinsent15-Dec-04 16:28
Vinsent15-Dec-04 16:28 
GeneralRe: exception in switching between panels Pin
The Man from U.N.C.L.E.15-Dec-04 22:29
The Man from U.N.C.L.E.15-Dec-04 22:29 
Generalerror on minimize Pin
Member 134908813-Dec-04 6:06
Member 134908813-Dec-04 6:06 
QuestionIS THIS A PATCH IN DATETIME CONTROL? Pin
manivannan.p13-Dec-04 1:29
manivannan.p13-Dec-04 1:29 
GeneralListView BackgroundImage property Pin
flip_trickle12-Dec-04 12:10
flip_trickle12-Dec-04 12:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.