.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Only one usage of each socket address (protocol/network address/port) is normally permitted IN C# Re

Posted By:      Posted Date: September 25, 2010    Points: 0   Category :.NET Framework


 I done an application in Remoting.Consider a server is running in my machine an listenening the port 8085(Remoting.Configure()) ,I have 2000 Clients They ALL send an update every 2MIN to the server through 8085.

I configure the port like this:

  1. public

  1. void InitNew()
  2. {
  3. try
  4. {
  5. if(_regcnt ==2)
  6. {
  7. MessageBox.Show("Unable to run the server you must restart the system","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
  8. Application.Exit();
  9. return ;
  10. }
  11. UNReg();
  12. chan=
  13. new TcpChannel(8085);
  14. ChannelServices.RegisterChannel(chan);

  15. View Complete Post

More Related Resource Links

No protocol binding matches the given address ''.

I am getting this error whenever I tried to open the svc file in the browser using the Visual Studio 2008. The puzzling part is the localhost address being interpreted as ' '. What are should I look for in order to troubleshoot this problem?Exception Details: System.InvalidOperationException: No protocol binding matches the given address ''. Protocol bindings are configured at the Site level in IIS or WAS configuration. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [InvalidOperationException: No protocol binding matches the given address ''. Protocol bindings are configured at the Site level in IIS or WAS configuration.][ServiceActivationException: No protocol binding matches the given address ''. Protocol bindings are configured at the Site level in IIS or WAS configuration.] System.ServiceModel.AsyncResult.End(IAsyncResult result) +4413209

Windows 7 socket bind behavior difference from XP/Server 2003, with reuse address socket option (WSA


I have two processes that are both listening to UDP packets and can run on the same PC.  One process binds a socket to one NIC address with port 18246.  The other process has two Socket objects, one for sending on port 18246 and one for listening on port 18246.  Both of these sockets are created, have the SO_REUSEADDR socket option set.  Bind is called for a single IP Endpoint for a common local NIC address, but a different one than used by the above app.

Under Windows XP and server 2003, both processes can bind regardless of order of startup.

Under Windows 7, if the process with only one socket starts first, the second process fails with WSAEACCES 10013 error with the second socket bind.

I wrote a sample C# app with the following method that fails when running under Windows 7 x86 and x64.  The above failure occurs when the sockets are in separate processes, but a single process using the same socket interaction also fails.  The below method is called with two IPV4 addresses that are assigned to local Network adapters on the PC.

How to connect a remote Sqlserver 2008 r2 server with IP address and port? I use SMO and VS2010.


how to write SMO's conn.ConnectionString with IP address and port?

Fetching IP address of all machines in a network


Hi, can any body help me out in programming for fetching the ip address of all the host machines connected in a network. Is there any windows api for this . Can we make use of socket to program.


Thank you.


Advanced Socket Connections - Connect using IP and MAC address

In .NET, is there any way to specify both an IP and a MAC address when connecting to a socket endpoint?

Here's the problem I'm trying to solve:
I'm building a peer to peer type application (not a file share app!) and I need the clients to be able to talk to each other.  If the MAC address is already known ahead of time (provided by a centralized server), is there any way to connect to the host and specify the MAC?

I've got a background in CISCO as well and I am pretty sure that technologically this is possible, however, I'm not sure if the sockets classes supports that.

IP Address Blocking or Restriction in SQL Server

"is it possible to block connections to SQL Server based on IP address". As far as now there is no official way in SQL Server to block the connections in SQL Server based on IP address. However this can be done from the OS end, we have the following three options available, refer HERE for more.

.RRAS IP Filter

my ip address

IP Tejji answers question like what is my ip address? find my ip addresss? detect my ip address? Best part is it also determines your local ip address as well as mac address. Further if you keen on browser specification and details regarding browser capabilities can also be found. It also help you see your geographic location. Other details that are available are Latitude, Longitude, timezone, country, region & city. In short it is one-stop-shop for very rich details about your IP and related information.

SOA Tips: Address Scalability Bottlenecks with Distributed Caching


SOA makes application scalability easier, but getting the best performance out of your SOA means paying close attention to the details. We'll give you some tips for coding your app more effectively and using distributed caching to remove data access bottlenecks.

Iqbal Khan

MSDN Magazine June 2010

Advanced Basics: What's My IP Address?


If you're like me, you regularly do tech-support for family, friends, and neighbors. You can't go to a party without hearing the familiar refrain: "I've just got a quick question. " It's always something-their Internet connections get dropped, they've got a virus, they can't install some piece of hardware, or some file has gone missing.

Ken Getz

MSDN Magazine December 2005

Find Country using IP Address c# ASP.Net


Hi experts,

how to find the names of countries  using the IP address.

This is my ip address

we are using in C# code please help me this one

Thanks an advance

I.P Address to Location ? by Programming (L I N Q) ? ?

Hello Experts .. Kindly Help me in this .... I have to fetch Location (country , state)  of IP by which orders are purchased .... I managed to get the IP Address of the coustmer by My main concern is location .... can i do this by Programming Via LINQ ....Is this necessary to use another database ... As i get the code which is in VB .... kindly Help me by converting this code in C# or LINQ ... or give me new suggestions ...______________________________________________________________________________________________________________________Protected Sub Button1_Click(ByVal sender As Object,_ ByVal e As System.EventArgs) Handles Button1.Click On Error GoTo HandleError Dim strGetIP As String Dim dblGetLongIP As Double Dim dblPrevPosition As Double Dim dblPosition As Double Dim dblNumber As Double strGetIP = orders.CoustomerIP For i = 1 To 4 dblPosition = InStr(dblPrevPosition + 1, strGetIP, ".", 1) --------- As i used online VB to C# converting this for loop is creating problem ... kindly .. If i = 4 Then dblPosition = Len(strGetIP) + 1 End If dblNumber = Int(Mid(strGetIP, dblPrevPosition + 1, dblPosition - dblPrevPosition - 1)) dblPrevPosition = dblPosition dblGetLongIP = ((dblNumber Mod 256) * (256 ^ (4 - i))) + dblGetLongIP Next

WebMethods, sends to wrong address (activities.aspx.aspx)?

I'm verifying e-mail address using WebMethods, however, I'm getting a 404 not found (error console) saying that it can't find activities.aspx.aspx. I am using URL-Rewriting, but I tried adding a detect for 'activities.aspx.aspx' and redirect back to .activities.aspx' but it didn't do anything.Here is the error:[HttpException]: The file '/activities.aspx.aspx' does not exist. at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandl

a question about getting url address

Hi!. i have a problem about getting url address. if a user call login page on browser's address part and the user has been authenticated, i want to redirect user the page that he requests. i try to use Request.Url/Request.UrlReferrer. But i couldn't. Thanks..

Can't bind a UDP socket to a port

using System; using System.Net; using System.Net.Sockets; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { int port = 11000; Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); IPEndPoint ipendpoint = new IPEndPoint(IPAddress.Any, port); try { socket.Bind(ipendpoint); Console.WriteLine("Successfully bound to port " + port); } catch (SocketException e) { Console.WriteLine("Winsock error: " + e.ErrorCode.ToString() + ", " + e.Message.ToString()); } Console.Read(); } } } I get the error code [b]10022[/b] when trying to bind the UDP socket, which is "Invalid argument specified". This is the same for all the UDP server examples on the internet at the binding stage, as well as the MSDN one. It will work if the port is 0, but not if the port is anything but 0. TCP binding works fine, and I can make a UDP server on any port with Java (the binding works fine) but in C# it gives me this error. The code works for everyone I've asked to try it, and I've got the latest NET framework (version 4) and Windows XP with SP3 so I know the commands are supported by the OS (also, Visual C# 2010 Express and 2008 Express both give this error). Any ideas to fix it?

Bad email address exception handling

 I have a form that used to send an email to someone who had posted  a listing on my site, with a copy to the sending user. The code below is intended to catch the exception that occurs when email address of the person posting the listing (TxtBxTo.Text) is not valid, and also intended to catch the (unlikely) event that the user has entered and confirmed an invalid email (TxtBxEmail.Text) for himself on the form. I have tested this code for all combinations of valid and invalid email addresses for the listing poster and the user filling out the form and sending the email Everything works fine except for the situation where the email address for the listing poster is valid but that of the user  is invalid. In this situation I am getting the message on the ConfirmResaleEmail.aspx page that says: "Your message has been sent to the contact person, with a copy to you. " when I should be getting "Woops, it looks like your own email failed when we tried to send you your copy. " I am hoping some sharp-eyed person can spot the problem.  Here is the code:         ' this sends email from a user with email TxtBxEmail to the contact perons listed in TxtBxTo        msg = New MailMessage(TxtBxEmail.Text, TxtBxTo.Text, TxtBxSubject.Text, sb.ToString())    &n

Custom WCF Service (svc) gives address scheme error

Hi, I'm reading a book by Sahil Malik on building solutions for SharePoint 2010 (from Apress). One of the items explained is how to create a custom WCF service that can then be consumed in different scenarios (.NET app, silverlight, javascript). I followed the steps as given in the book, but when I try to open the URL to the service, I get this error: This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection. Parameter name: item I have to mention that when I added the mapped ISAPI folder to my VS project, it didn't create the project subfolder automatically and I accidently created my files (svc and web.config) on the root level of the ISAPI folder. I created the subfolder manually and moved these two files in the subfolder, but it doesn't seem to work. Maybe I overwrote something on the root of ISAPI ? My web.config contains this: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> <bindings> <basicHttpBinding> <binding name="customBasicHttpBinding"> <security mode="TransportCredentialOnly"> <transport clientCredentialType="Ntlm" /> </security&g

Is it possible to connect to a machine within a Lan if given mac address?

If a machine is within a Lan, with a Lan IP address such as, and its mac address is fixed and known, such as A4:B5:......, the machine is connected to internet through a router with a public IP address. Is it possible to directly connect to the machine from internet using its router IP address and its mac address?   thanksRegards! directfriends.net
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend