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

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

Getting Error in Socket Programming...

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

I am creating one application with socket programming.
I am using visual studio 2008 with windows 7.
I am getting a error Message...

at line....



"No connection could be made because the target machine actively refused it"

class Class1{



void Main(string[] args)



IPAddress[] ipAddress = Dns

View Complete Post

More Related Resource Links

Socket Programming-error


AsyncClient.cs(247,40): warning CS0618: 'System.Net.IPAddress.Address' is obsolete: 'This property has been deprecated. It is address family dependent. Please use IPAddress.Equals method to perform comparisons.

Webservice using socket layer programming



   I want to access a webservice in asp.net programming. This webservice was done using socket layer programming and also i am having the ipaddress and port address. Did any one know about how to access webservice using socket layer and if know let me know how to access the webservice. Thank you

10 MB File Download In ASP.NET Socket Error

Hi,I received the following error message, when downloading file of 10 MB. Please let me know the solution. I already configured the httpRuntime value to <httpRuntime maxRequestLength="10250 " executionTimeout="1000". Still I am getting the error message.The description for Event ID ( 0 ) in Source (XXXXX) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Unable to read data from the transport connection: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full. Source: mscorlib TargetSite: Void HandleReturnMessage(System.Runtime.Remoting.FileUploading.IFileUpload, System.Runtime.Remoting.FileUploading.IFileUpload) StackTrace: Server stack trace:    at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)   at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)   at System.IO.BinaryReader.ReadBytes(Int32 count)   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadArrayAsBytes(ParseRecord pr)   at System.Runtime.Seri

C# Socket programming

Hi,       Im having a problem with some socket programming and im hoping someone here can help me. basically im trying to bind a listener to a port. I have used some source code i obtained from the net, however the code was a few years old and contained the obsolete "Dns.Resolve(string.Empty);" method to get the IPHostEntry information. Ive tried to replace this with "Dns.GetHostEntry(string.Empty);" however my code does not seem to be excuting past this point so im wondering if i have a logical error. this is the original method private void AcceptConnections() { IPHostEntry localMachineInfo; IPEndPoint localEndPoint; Socket listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); try { localMachineInfo = Dns.Resolve(string .Empty); localEndPoint = new IPEndPoint(localMachineInfo.AddressList[0], _port); // Bind the listener socket to a local port listener.Bind(localEndPoint); // Set the socket in a 'listener' mode listener.Listen(10); // Continue accepting and processing new connections indefinitely while (true ) { threadEvent.Reset();

Windows PGM socket access error with non-admin account




I'm trying to use PGM sockets to send data. I can listen and receive data fine from a PGM socket using a non-admin account, but when I try to create a socket to send data I get an exception at this step:

socket.Bind(new IPEndPoint(IPAddress.Any, 0));

The exception is:

An attempt was made to access a socket in a way forbidden by its access permissions

Note that if I run the same code under an admin account it works fine. Is there a way to create a sender PGM socket without running under an admin account?

TCP error code 10013: An attempt was made to access a socket in a way forbidden by its access permis



I created two services and their clients. One service calls second inside its method. I use impersonation from client to call first service that uses impersonation to call second service, and then i get exception:


Could not connect to http://localhost:1690/BusinessConfigurationService. TCP error code 10013: An attempt was made to access a socket in a way forbidden by its access permissions


Server stack trace:

   at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()

   at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)

   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)

   at System.ServiceModel.Chan

Socket Connection Error


Hi All,

Am using socket connection to send and receive values. The following code is used to receive response.

  while ((sizeReceived = skt.Receive(bytesReceived, bytesReceived.Length, SocketFlags.None)) > 0)
                       nTotalBytes += sizeReceived;
                       sCleanresponse += Encoding.ASCII.GetString(bytesReceived, 0, sizeReceived);
                       //Giving time to read the remaining amount
                       if (skt.Available > 0)

In the above code, am facing a prob in skt.Available. If i dont give the thread.sleep, it is not repeating the while loop and it exits after onetime. And if i dont give skt.Available line, sometimes it throws socket Exception. I do not want to use thread.sleep. Does anyone knows why this is happening and how can i resolve this? 

Get Same Buffer Size in Socket Programming


Dear All,

Actually i am developing an app which send audio file from client to server and server read the byte and save that file in waver format problem is that  i want to send buffer size of audio file or audio length to server but didint get the same size so plz help me regarding this prob

i am using c#

Coding / Programming Tips for C#

Using proper guidelines and a template-framed style of coding will really helps developer to enjoy the coding with more understandable, reliable code and application development.

C# Object Oriented Programming

So far in C# Essentials we have looked at the basics of programming in C# such as variable types and flow control. Although it would be possible to write a functional program using these techniques, there is much more to becoming a proficient C# programmer. C# is, above all, an object oriented programming language and as such any C# programmer will be expected to create object-oriented applications using this language.

Object Oriented Programming

Four core concept of OOP Object Oriented Programming. 1.Inheritance, 2.Polymorphism, 3.Abstraction and 4.Encapsulation

Object-Oriented Programming Concepts

This is the first in a series of articles describing the use of object-oriented programming techniques as implemented by the C# programming language. This series follows the C# Fundamentals tutorial that beginners are advised to read first.

Parallel port complete: programming, interfacing & using the PC's parallel

Parallel port complete: programming, interfacing & using the PC's parallel


IsapiModule Error 500 Issue


I am about exhausted trying to figure out this error:

HTTP Error 500.0 - Internal Server Error

Description: The page cannot be displayed because an internal server error has occurred.

Error Code: 0x8007007b

Notification: ExecuteRequestHandler

Module: IsapiModule

Requested URL: http://localhost:80/ReportServer

Physical Path: c:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer

When I enable Failed Request Tracing Rules and view the log output I am supposing that the actual problem is in the 2nd call where there are 2 backslashes before the actual filename in the specified path:


CALL_ISAPI_EXTENSION DllName="C:\Windows\Microsoft.NET\Framework\v2.0.50727\\aspnet_isapi.dll"


Handling 404 page not found with Error page



      How do i handle 404 page not found?

Inserting personal error message in ValidationSummary



I am creating a web form that requires a lot of validation. I use many of the validation control in asp.net already like RequiredFieldValidator and CompareValidator. 

My Problem: after my custom validation for the value entered return an error message, and I pressed enter key when the field is empty, my custom error message is overlapped by my ValidationSummary. 

Setting my custom error to visible = false on button click also does not seem to work as it requires for me to enter the value first.

This made me think, is there a way to insert my custom validation inside the ValidationSummary as an error message like for other validation control?

Thanks in advance

Sys.Net.WebServiceFailedException: The server method '' failed with the following error:



Let's say we have 2 time consuming functions, aaa and aaa1 inside a aspx page.

        public static string aaa(int i)
            return i.ToString();

        public static string aaa1(int i)
            return i.ToString();



        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        <span id="displayspan"></span>
        <br />
        <input type="button" value=
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