Questions tagged [system.net]

System.Net is a namespace of the .NET framework. It provides a simple programming interface for many of the protocols used on networks today.

System.Net is a namespace of the .NET framework. It provides a simple programming interface for many of the protocols used on networks today.

References

297 questions
3
votes
3 answers

Would Asyncronous TCP networking be a better option for a dedicated server with up to 32 players playing at the same time in C#?

Currently I'm planning to design a dedicated server in C# for an XNA game where up to 32 players will be able to connect at the same time. I have had experience in networking with System.Net, but I've not had to deal with quite a large player count…
seandewar5
  • 299
  • 1
  • 3
  • 10
3
votes
0 answers

How to set system.net settings inside wpf application

In WPF project I am getting this error: private void btnRetrieve_Click(object sender, RoutedEventArgs e) { Uri uri = new Uri("http://10.214.36.245", UriKind.Absolute); using (WebClient wc = new WebClient()) { byte[] barr =…
uzay95
  • 16,052
  • 31
  • 116
  • 182
3
votes
3 answers

How to improve slow DNS with HttpClient?

I have one request for a specific domain that take a really long time to complete : 22 seconds in average. The request itself does not return a lot of data. var httpClient = new HttpClient(); //instantiated at app start and reused var request =…
tigrou
  • 4,236
  • 5
  • 33
  • 59
3
votes
1 answer

C# System.Net trace log - only trace one method and ignore others?

I'm using System.Net tracing as described here: http://ferozedaud.blogspot.com/2009/08/tracing-with-systemnet.html But that traces every request made with HttpWebRequest. The trace file is huge. I only want to trace what happens when I am calling…
JK.
  • 21,477
  • 35
  • 135
  • 214
3
votes
3 answers

System.Net.IPAddress returning weird addresses

I am writing a (rather simple :) networking application, and am testing it using localhost:27488 (127.0.0.1:27488). I am using a System.Net.Sockets.TcpClient for the connection, which takes a System.Net.IPAddress to specify the host... the only…
Nate Koppenhaver
  • 1,676
  • 3
  • 21
  • 31
3
votes
1 answer

Could not create SSL/TLS secure channel since partner webservice upgraded using System.Net and client certificate authentication

We have an application that use to call a webservice secured by SSL client certificate. Our partner upgraded their gateway and since this upgrade we are not able to call their web service anymore. Here is the c# code that used to work …
asidis
  • 1,374
  • 14
  • 24
3
votes
1 answer

.netcore web application failing with 'buffer supplied to a function was too small' error

I have a web application running which basically calls 3 very basic API that retrieve data from a 3rd party, save it in a json file and load this data for further processing. At first, the web application was working fine, however as time went by I…
3
votes
1 answer

VS Enterprise .NET Build Extensions version of System.Net.Http overrides intended 4.3.3 nuget version

I'm currently using Visual Studio 2017 Enterprise edition. The issue I'm running into is that every time I install the latest System.Net.Http nuget package (4.3.3) into a project, the System.Net.Http reference seems to prefer to point to the VS…
TheDude
  • 1,421
  • 4
  • 29
  • 54
3
votes
2 answers

System.Net's Webclient in C# won't connect to server

Is there something I need to do to get System.Net working with Microsoft Visual C# 2008 Express Edition? I can't seem to get any web type controls or classes to work at all.. the below WebClient example always throws the exception "Unable to connect…
Alpants
  • 766
  • 2
  • 8
  • 19
3
votes
1 answer

How to get string representation of a MultipartFormDataContent

Is there a way to get the string representation of a MultipartFormDataContent for debugging purposes? I have tried var x = multipart.ToString(); but it returned System.Net.Http.MultipartFormDataContent instead of something like the following…
Damn Vegetables
  • 11,484
  • 13
  • 80
  • 135
3
votes
0 answers

WebSocket Vs ClientWebsocket in C#

I have a C# class to manage a connection between a server and a win forms app. This class sets up a message queue and sends and receives data across the Socket. My original intention was to use the same class on both the client and the server to…
Lightning77
  • 313
  • 5
  • 14
3
votes
2 answers

Does Operation Timed out exception in httpWebRequest.GetResponse() method close the connection

My question might be silly, but need an answer. As far as I know whenever "The Operation has timed out" exception occurs in HttpWebRequest.GetResponse() method than connection is closed and released. If it is not true than how does it work? I…
Nps
  • 1,638
  • 4
  • 20
  • 40
3
votes
3 answers

What sense does asynchronous IO make if the thread is blocked anyway (see example)

I found an example for async ftp upload on msdn which does the following (snippet): // Asynchronously get the stream for the file contents. request.BeginGetRequestStream( new AsyncCallback (EndGetStreamCallback), …
codymanix
  • 28,510
  • 21
  • 92
  • 151
3
votes
1 answer

How do I set ServicePointManager.DefaultConnectionLimit in the portable framework

I need to use multiple tasks that will hit a webservice end point. Each task will be streaming data and will have a httpWebRequest connection open. I need to set the property ServicePointManager.DefaultConnectionLimit to a value greater than 2, but…
3
votes
2 answers

AuthenticationHeaderValue can not be set

I can trying to set an authentication value just for testing purposes. I am not using basic authentication but just a String VC.Request.Headers.Authorization = new AuthenticationHeaderValue("Secret Password"); It gives me this error that is making…
noobiehacker
  • 1,099
  • 2
  • 12
  • 24