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
Similar Messages:
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
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
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
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
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
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
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
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
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
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
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
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
Jan 6, 2010
Currently I am functioning on a project (Winfroms). Where I can able to communicate with the USB device and send/read data from it using the WINUSB custom driver. This will work only in windows. Now currently the client want this in web whereas independent of OS (Linux, Mac, Windows). Accessing a driver from a client side to send/read data that too for different OS.
View 2 Replies
Mar 3, 2011
explain me Secure Socket Layers (SSL) and how it provide the functionality of encryption and decryption of data ?
View 1 Replies
Jun 24, 2010
[Code]....
View 3 Replies
Feb 20, 2010
ASP.NET 2.0 and COM Port Communication
I have a managed DLL which communicates with the devices attached on COM/Serial ports. The desktop Winforms application sends requests on ports and receives/stores data in memory. In Winforms app I have added a reference to DLL and I am using the methods. This works well. Now, there is a situation where I need to show this data from serial/com port on a web-page. And also users should be able to send requests to the ports using this DLL. I have made a web app in ASP.NET (2.0). Added a reference to the DLL. I am able to use this DLL, the DLL communicates on the COM upon button click on web-page and also the response is shown on web page. However I am not happy with the approach and strongly feel that this is a bad approach. Also the development server crashes after 3 -4 requests. What is the best approach in this scenario. If I use a windows service then how would my ASP.net app will communicate with the Weindows service.Or can this be easily done using WCF. I have not used WCF any time nor any of .net remoting technique.
View 1 Replies
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
Oct 26, 2010
Is it possible to build a windows application to send articles to a blog I have developed?
View 1 Replies
Jan 15, 2011
So I am working on a project in ASP.NET MVC 2 with C#.I have a View with a file upload but this is a flash component (.swf).The result of the file upload (the storing of the file and processing of data in the database) is done in a HTTPHandler.I would like the HTTPHandler to send information to my active controller.
Is there a way to get the controller that was used to load the view? I'm having problems finding information about it online.
View 1 Replies
Apr 13, 2010
I'm running an ASP.NET WebService on IIS 6.0 that shows a lot of HTTP 500 (probably just exceptions from the WebService) inside the log at %systemroot%System32LogFilesW3SVC1 on a customers site.
Is it possible to log the content of those HTTP responses and there requests without modifying the WebService using IIS or a plug-in for IIS?
I thought of using Wireshark or Fiddler to sniff on the HTTP traffic but I would prefer to just turn on an option inside IIS to make him log the communication (this should not be to hard since it is logging the requested URLs anyway)
View 2 Replies
Oct 15, 2010
I have an ASP.NET app running on a webserver. A third party is created another app in PHP which needs to send data to my app for processing. Initially it was assumed that the PHP app would be deployed elsewhere so we agreed that the communication would occur over the internet via HTTP (over SSL). My app would simply use a generic handler (ashx) file to recieve the data and send confirmation back.
Now it seems that the PHP app might be deployed on the same machine as my app. I like the fact that using HTTP (as opposed to say direct database access), the PHP app needs to know nothing at all about how my app works. But using the public internet seems silly for communication between two apps on the same machine. If the PHP app simply used a localhost address, would this ensure that all the data stays within the machine? Is there a better way to do this?
View 4 Replies
Jan 20, 2010
I have two web parts WebPart1 has a tree control1)WebPart2 gets displayed when a node in a tree is clicked.2)User can enter a text in web part 2 and click ok button then Web part1 has to be refreshed and the new node should get displayed In step 1 WebPart1 is Provider and WebPart2 is consumer.In Step2 its vice versa. Is it possible to swap this using the provider consumer?
View 1 Replies
Oct 28, 2010
I am create an iPhone app that needs to talk to a Windows C# app. The app will run as either a Service or Form Application.
What would be the best way to accomplish this? Ideally exposing a service-type architecture would be best as I don't need a stateful connection (stateless is fine in this case).
Can a WCF service hosted by my app using a form of TCP binding be consumed by my iPhone? Or can an app host using httpBinding without the aid of IIS or some other web server?
View 3 Replies
Sep 21, 2010
To guarantee optimal performance, aspnet_isapi uses asynchronous named pipes to forward requests to the worker process and to get responses. On the other hand, the worker process exploits synchronous pipes when it needs to query for information about the IIS environment (that is, server variables).
Does the worker process always uses "synchronous" named pipes? (Response to aspnet_isapi.dll would be asynchronous too, right?) Can the worker process talk directly to IIS or does it have to send a synchronous request to aspnet_isapi.dll to inquire about IIS environment etc.?
View 1 Replies