UC Managed API (UCMA) v1.0 beta available

I was eagerly waiting since a long time to write about this exciting news, With the public annonucement of OCS 2007 beta, now we have a managed API known as UCMA is publicly available. Before coming out with official name UCMA, we were internally calling it as Ucp.net sdk. This SDK opens up the Sip signaling…

16

You need to be careful about using event handler for NetworkChange

Actually the issue I am discussing here is in general true for any event handler. .net event handler are strong reference. In case of NetworkChange it become more important because both event handler on NetworkChange object are static handlers, so there life time is the lifetime of the process. For example you may be using code like below…

4

Use object pooling of byte arrays to prevent heap fragmentation in socket applications

When you are worrking on managed socket application and your application is very extensively doing send/recieve on the socket, then probably you need to care about understanding the heap management. Socket.Recieve or Socket.Send finally need to call the underlying native winsock API call to recieve the data on user specified buffer. Same is true for NetworkStream.Read and NetworkStream.Write calls,…

3

WebException message vs. Response.StatusDescription on FtpWebRequest

Recently one of the reader asked an interesting question, he was using FtpWebRequest with MakeDirectory method, if directory already exist then application received the WebException with message.”The remote server returned an error: (550) File unavailable (e.g., file not found, no access).”. This exception message appears to be very generic and not helping the user to figure out what…

1

Using FtpWebRequest to do FTP over SSL

Last few weeks we were busy to get Whidbey Beta-2 bits ready for release. If you are looking for some API where your application could talk to a FTP server, which supports SSL. FtpWebRequest under System.Net namespace is your solution. Here I will just point to SSL specific features of the class Enabling FtpWebrequest to use…

31

Use NetworkInformation classes to get the list of listening ports on your machine

.Net frameworks 2.0 have new addition of Namespace, System.Net.NetworkInformation, it provide a number of interesting classes to extract the network related statistics and state of the machine, it pretty much provide most of the functionality which is exposed by native IPHelper APIs. Earlier I had shown a simple example for getting network availbility event notification. Here…

5

Update Windows Form UI with Network Available Change Event

.Net frameworks 2.0 has a new namespace System.Net.NetworkInformation, which you could use to gather various network statistics on the machine, it also provide two interesting events NetworkAddressChanged and NetworkAvailabilityChanged. If you are writing winform application and want to update some UI information based on network availability status, then Network availibility changed event is very handy…

7

Does your application require customizing System.Net.WebPermission, SocketPermission or DnsPermission settings?

.Net frameworks comes with deefault security settings where components running under Intranet, Internet Zone can only have WebPermission to connect back to the server, from where they are downloaded. Also the component from Intranet zone and Internet zone don’t have any SocketPermission and DnsPermission by default. I am trying to find out some real world usage…

2

Resuming broken file download with FtpWebRequest class

This post is valid for .Netframeworks 2.0 When we are downloading a large file from ftp site and connection got broken in between, on next attempt you would be interested in downloading the rest of the file content instead of full file. FtpWebRequest class have a nice way to meet this requirement. You could use the…

20

Create your own asp.net hosting server with System.Net.HttpListener

.Net frameworks 2.0 contain HttpListener class under System.Net namespace and a number of ASP.Net hosting classes under System.Web.Hosting namespace. HttpListener class is implemented on top of low level protocol stack http.sys, probably you also know that IIS 6.0 is also architected on top of http.sys. So user of HttpListener class could get advantage of many of the…

3