Cannot Make Socket Connection

Jul 28, 2010

Iam trying to make a socket connection and am facing with the following error.

Socket tempSocket =new
Socket(ipe.AddressFamily,
SocketType.Stream,
ProtocolType.Tcp);

The tempSocket is connected to the particular IP and tempSocket.Connected is giving me value as True. But the property MultiCastLoopBack property is giving me the following error with error code 10042.

"An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call."

So is there any problem with the IP or Tcp is not supported with Stream as SocketType?

View 3 Replies


Similar Messages:

Web Forms :: Using Socket Connection / Error?

Oct 22, 2010

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

[Code]....

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?

View 4 Replies

State Management :: Keep Socket Connection Open?

May 26, 2010

I wrote a small socket client application talking to my asp.net server application.

On the asp.net side, I created a IHttpHandler. I want to send data back and forth on one HTTP request.

I tried the following code which run an infinite loop inside function ProcessRequest(). The client side opens a socket connection and send HTTP POST request.

I am not sure how asp.net work. In HTTP POST I have to specify Content-Length, I tried a small value, like 20, then asp.net handler can only get 20 bytes in the inputstream. I tried to use 4096000 bytes(close to the maximum IIS allowed), then the inputstream cannot get anything, it seems IIS is waiting for all data(4096000) to come from client side before it gives the handler a chance to read from the socket.

public class DeviceDataHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
try
{
Stream inputstream = context.Request.InputStream;
Stream outputstream = context.Response.OutputStream;
/loop forever until exception is thrown
while (true)
{
ProcessData(inputstream, outputstream);
}
}
catch (Exception ex)
{
ZenLog.logError("DeviceConnector exception: " + ex.Message);
}
}
public bool IsReusable
{
get
{
return true;
}
}
}

View 1 Replies

Web Forms :: How To Make Default.aspx Or Homepage A Secure Socket Layer Page

Sep 1, 2010

1)How to make Default.aspx page a Secure socket layer page?

2)How much code does this take?

3 Is it easy ? i have no idea how this works

View 3 Replies

How To Make Database Connection Class

Jan 19, 2011

how make the class for database activities and it can be used in code behind

coz i want avoid the connection opening, closing activities, insert,update etc methods in code behind frequently.

the class should include connection open and closing method, passing values to stored procedures etc.

How should we construct it?

View 8 Replies

C# - Make Connection To Database Only Once On Page Load?

Oct 12, 2010

When I load my page I populate my repeater with the following code.

Dim conn As Data.SqlClient.SqlConnection
Dim Comm As Data.SqlClient.SqlCommand
Dim reader As Data.SqlClient.SqlDataReader

[code]...

View 1 Replies

Configuration :: Make A Sql Connection In The Master-file?

Jun 9, 2010

Is it possible to make a sql connection in the master-file for my asp.net website, that all included sites have the connection too? Like when I include a header-file in asp classig.

View 1 Replies

WCF / ASMX :: Unable To Make Connection Between Client And Service

Apr 30, 2010

I receive the following error, when trying to consume Wcf service:

"An existing connection was forcibly closed by the remote host". Consuming the service works fine when the host and the client are on the same machine. When I move the client to Hyper-V virtual machine (I didn't try it on a real computer) - it throws the error. Both firewalls are turned off Do you know what can cause such behaviour? Here are the details:

Both the client (hyper-v) and the service are on Windows server 2008 R2

Service url - http://wcftest/CalculatorService.svc (wcftest is the website and is mapped in the hosts file to localhost)

Service config:

[Code]....

Client config:

[Code]....

Are there any configuration settings which I'm missing?

View 1 Replies

DataSource Controls :: How To Retrieve The USERID That Is Being Used To Make Connection

Mar 18, 2010

If I m using Windows Auth in my connectionstring i.e Integrated Security = SSPI / Trusted_Connection = Yes,

Is there any way to retrieve the USERID that is being used to make connection?

View 3 Replies

Web Forms :: Make A Connection From Aspx Page To Oracle

Feb 21, 2010

I want to setup a DB connection from aspx page and not from aspx.vb.

View 1 Replies

DataSource Controls :: Unable To Make Connection To Database?

Aug 16, 2010

I try to connect my database for so long so i wrote two type of codes. Let's discuse first on.

I have database called PhoneDirectory.

It have only one table named Residents.

I have button wiht ID="Button1".

I want when i click this button to see all of my residents.

I want to see the result in DetailsView and to be able to edin, delete and add new resident.

First try with SqlDataSource so i wrote this:

<asp:SqlDataSource ID="Resident Details" runat="server" ProviderName="System.Data.SqlClient" ConnectionStrings="<%$ ConnectionStrings:ThisIsTheConnection%>"

View 57 Replies

Databases :: Cannot Make Connection While Uploading Large Amount Of Data

Mar 6, 2010

have developed a Asp.net application which uploads data from Excell Sheet and then Inserts those data after doing several Checks to the Mysql data base.The Issue which Iam facing is that when Iam uplading lage amount of data at a time say around that 10000, the application crashes and gives the Unable to Open connection to server Error.The same app works well 1000-2000 data.

View 1 Replies

Web Forms :: Make A Connection Between A Word In The Cell (href) And A Rule Of The Same Or Another Tab?

Sep 5, 2010

How to make a connection between a word in the cell (href)?and a rule of the same or another table with sql. Is there also finished editors?

View 3 Replies

Socket Programing By C#?

Nov 15, 2010

Is this Possible that write a Socket by C# in ASP.net ?

for Example Can i write a Code Like this Perl Code in C# and asp.net ? :

> use HTTP::Request::Common qw(POST);
> use LWP::UserAgent; $ua = new
> LWP::UserAgent(agent => 'Mozilla/5.0(Windows; U; Windows NT 5.1; en-US; rv:1.8.0.5)Gecko/20060719 Firefox/1.5.0.5');
> $ua -> timeout(20);
> my $req = POST 'http://Example.com/',
> [ login_username => 'mehdi' , login22 => '654321' , go => 'submit'];
> my $content = $ua->request($req);

View 1 Replies

Visual Studio :: Error Unable To Add Data Connection. ExecuteScalar Requires An Open And Available Connection. The Connection's Current State Is Closed?

Sep 13, 2010

I'm using Visual Studio 2008, and my database is SQL Server 2000.

I want to add a connection to the Server Explorer in VS. The Data source is Microsoft SQL Server (SqlClient). After entering in all my information and I click Test Connection, it is successful.

But when I click OK, I get the error:

Unable to add data connection. ExecuteScalar requires an open and available connection. The connection's current state is closed.

View 3 Replies

Architecture :: Socket Communication Between C And C#?

Mar 22, 2011

I've a project in C which acts as a server and accepts socket communication. The server project has multiple C files is an exe which accepts messages from the client program and responds accordingly. I've to write a Client program in C# which should open a socket communication and send a series of messages depending on the result of previous message sent.

Is it possible to send a message in such a way that it will call a function in one of the C file in the server project?

View 1 Replies

Architecture :: MSMQ And Socket Programming In Web?

Dec 31, 2010

I am working on live trading system, in this web system i have to show live data so i am calling my store procedure for bind my data. I have few questions -

Is it possible to use MSMQ in web ?
Is it possible to use socket programming in web ?

Its because i am calling SP in every 5 seconds and its very lengthy. I want to use socket programming or MSMQ in LIVE trading system because if any thing update or modify in tables then only web page get notification from MSMQ or Socket and i will bind my page then only. And if possible then its secure and perfect for web live environment ?

View 8 Replies

How To Do Client Asynchronous Socket In Application

Aug 6, 2011

I am in the progress build a client ASP.NET application (C#) that can display messages from a server application as soon as it receives them.

At the moment I am using an Asynchronous Client Socket but the OnRead event does not fired as soon as the server sent the strings

How to do client asynchronous socket in ASP,NET?

View 1 Replies

Create Packet Header Using Socket Programming C#?

Jun 11, 2010

I want to create custom packet header and append it to data.and send the data to remote machine using socket programming C#.

View 1 Replies

A Socket Operation Was Attempted To An Unreachable Host / How To Fix This Error

Jun 5, 2010

I'm calling Another url from my web aspx page. I'm writing

[code]....

But I'm getting error

A socket operation was attempted to an unreachable host 208.101.14.59:80

I tried the same url by pasting it on address bar and works fine. When I call my vendor they r saying that there is no any problem from their side. Someone has suggested me that there may be some settings in web.config.

View 9 Replies

C# - How To Send Data From Socket Server To Aspx Page

Dec 3, 2010

I want to send socket information to aspx page.eg. I have 80 clients connected to server. Server is doing some calculation based on the user input and if one of the condition is true, it will send the signal to all the connected clients. I'm the client. The other vendor is the server. Currently, my application is windows based, I want to change it to web based. So, When the server send the signal , I want to receive this signal from the web page.

View 1 Replies

C# - Hosting A Socket Service In Asp.net - Issues With Application_start & Application_end?

Dec 20, 2010

We have a component that needs to sit in asp.net that creates a listening socket on a well known port.The reason we have the socket is the asp.net need component needs to received events from external services and other technologies weren't quick or flexible enough.We start the socket listening in application_start,and close the socket in application_end. The issue is if we are receiving http requests to the web site, and modify the web.config, the application_start event is called before the application_end is called,so we cannot open the socket (we get an error about duplicate socket being open). We dont have a reference to the original socket in the application_start after the web.config change, so we cannot shut it down from there.

View 3 Replies

IIS Configuration :: A Socket Operation Was Attempted To Unreachable Host IP 587

Jan 31, 2014

I write code for sending mail. Its working fine in local  at Execution time. After i Hosted into server. it shows the Error.

A socket operation was attempted to an unreachable host [IP]:587

code:

Dim mail As New MailMessage
mail.To.Add("xxx@abc.com")
mail.From = New MailAddress("yyy@gmail.com")
mail.Subject = "Subject"
mail.IsBodyHtml = True
mail.Priority = MailPriority.High

[Code] ....

View 1 Replies

How To Pass Binary Value To Active Socket Object 3.5 - Dll Function WriteAsUnicode

Aug 5, 2010

I am using one DLL file of Active Socket Object 3.5 and it has one function writeAsUnicode which take String as parameter. But I need to pass binary value. In ASP, it can be done but in asp.net it becomes problem. So is there any other way to solve it.

View 1 Replies

Secure Socket Layer (SSL) - How It Provide The Functionality Of Encryption And Decryption Of Data

Mar 3, 2011

explain me Secure Socket Layers (SSL) and how it provide the functionality of encryption and decryption of data ?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved