0

I have created an Android application which sends a string over wifi to a console server on my computer. Basically, when a user touches the button on the Android application, the app sends a "connect" string to the server, pressed again and it sends a "disconnect" string. Once the string is received I need to pass it from the console server to a windows form running on the same machine. This is where I'm stuck, how do I send a string from the server to the windowsform application? I'm using C# btw... Thanks

1
  • What's preventing you from using the same mechanism you used to connect between the android app and the console app ? Commented Jan 19, 2014 at 12:47

5 Answers 5

1

You may use this class NamedPipeServerStream

[HostProtectionAttribute(SecurityAction.LinkDemand, MayLeakOnAbort = true)]
 public sealed class NamedPipeServerStream : PipeStream
Sign up to request clarification or add additional context in comments.

Comments

0

You need to "communicate" with it ;). Use WCF or create your own TCP/IP socket client/server app between the 2 .net apps.

Comments

0

As T McKeown suggested, you can create a Socket Listener

The link provides a complete example (Client and Server). In your case the client will be android, which will be different.

Comments

0

There are various way to achieve that. The technical term for what you want to do is Interprocess Communication (IPC) and there are many different ways to do that.

Since you are using .NET on both client and server your task is significantly easier: you can use the Windows Communication Foundation. WCF allows you to easily create a client/service that communicate over various channels, incuding TCP/IP and Named Pipes.

You can find a Small Sample Project WCF service on CodeProject.


Other methods would be sockets (TCP or even UDP), named and anonymous pipes, files on shared network folders, shared memory or message queues.

Comments

0

Another possibility is to use named pipe streams, which also works over internal networks. For communication between two applications, you could use what you seem best. Read this documentation on MSDN on named pipe streams.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.