Grimtron
Grimtron

Reputation: 6933

Access running mono application via command line

What is the best way to access a running mono application via the command line (Linux/Unix)?

Example: a mono server application is running and I want to send commands to it using the command line in the lightest/fastest way possible, causing the server to send back a response (e.g. to stdout).

Upvotes: 2

Views: 530

Answers (4)

Gabriel Burt
Gabriel Burt

Reputation: 837

Mono's gsharp tool is a graphical REPL that lets you Attach to Process.

Upvotes: 1

Charles Stewart
Charles Stewart

Reputation: 11837

You can use the system.net.sockets abstractions to create a service on a TCP port, and then telnet to that port.

Check the library status page; Mono's coverage here is a bit patchy.

Upvotes: 0

Grimtron
Grimtron

Reputation: 6933

@Rich B: This is definately a suitable solution, which I already had implemented - however on the server I have to use, the remoting approach takes around 350ms for a single request.

I've measured the time on the server side of the request handling - the request is handled in less than 10ms, so it has to be the starting of the client program and the tcp connection, that takes up the time.

Hence the hope that I can find another way to post the requests to the server application.

Upvotes: 0

GEOCHET
GEOCHET

Reputation: 21323

I would say make a small, simple controller program that takes in your required command line arguments and uses remoting to send the messages to the running daemon.

This would be similar to the tray icon controller program talking to the background service that is prevalent in most Windows service patterns.

Upvotes: 1

Related Questions