Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8467845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:45:48+00:00 2026-06-10T15:45:48+00:00

I’ve written a small server component in .NET 4.0 that uses the TcpListener ,

  • 0

I’ve written a small server component in .NET 4.0 that uses the TcpListener, Socket, NetworkStream and SerialPort classes, all of which are in the System.dll assembly (v4.0.30319).

It runs as a command line application, so doesn’t have any UI requirements.

Its currently running in Windows and my current goal is to get it working on Linux. One way to do this would be to use the latest version of Mono. Does anyone have any hints or gotchas which I should look out for – is this feasible?

Any suggestions greatly appreciated, thanks.

Structure of the application:

  • Listen on a TCP port for a client connection, accept when needed.
  • Main loop :-
    • Read data frames from the serial port.
    • Forward the data frames to the client over TCP.
    • Receive various commands from the client over TCP, and act on them as required.

UPDATE:

I’ve ported a stub program which only implemented the basic functions of TcpListener, Socket, NetworkStream, TcpClient and SerialPort.

It worked fine apart from the SerialPort’s DataReceived event handler, which doesn’t get called by Mono. The solution was simply to poll the port at a regular interval. Another minor change required was to not access the ‘ReceivedBytesThreshold’ property of the serial port; trying to set this in mono will throw an ‘Unsupported feature’ exception.

Ubuntu VM

I installed it inside a VirtualBox VM of Ubuntu Desktop 12.04, including serial port mapping from the host (Win7) to guest OS which worked fine to map COM1 to /dev/ttyS0. A final note, you have to run the resulting application as superuser (sudo) or else it complains about serial port permissions at runtime.

Raspberry Pi

I have also just got this working under Mono on a Raspberry Pi single board computer with some help from our hardware engineer who created a custom extension board to talk to the RPi’s onboard UART (via GPIO). The OS you need to run is the “soft float” Debian distribution, available on the Raspberry Pi download section. Installing Mono on it is a breeze, using the apt-get package manager. The serial port name in this case is /dev/ttyAMA0.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T15:45:50+00:00Added an answer on June 10, 2026 at 3:45 pm

    The easiest way is to just try and build it using mono and see if it runs. Mono has a compatibility analyzer as well which can run through your code and see what potential compatibility issues it has.

    It doesn’t sound like you should have any real problems considering you’re dealing with pretty standard classes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.