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

  • Home
  • SEARCH
  • 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 6740443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:36:23+00:00 2026-05-26T11:36:23+00:00

I have a C# application (which is the client) and I have a server.

  • 0

I have a C# application (which is the client) and I have a server. Now the server gets and sends all sorts of messages which are strings to the client, I am using StreamWriter for this, now the sending message on the client and the server looks pretty the same, I take the string encode it to UTF-8 and then send it

public void SendMessage(String p)
{
    if (p != "")
    {
        string StringMessage = HttpUtility.UrlEncode(p, System.Text.Encoding.UTF8);

        try
        {
            swSender.WriteLine(StringMessage);
            swSender.Flush();
        }
        catch (IOException e)
        {
            //do some stuff
        }
    }
}

now,the strings I send is something like this:

"SUBJECT@@@@SOMEDATA1<><>SOMEDATA2<><>SOMEDATA3

This causes some problems, and makes me think. Is this the way big applications send/ receive data? Because it looks pretty silly. If no, then can some one provide an example on how big applications send messages?

Also: my way of sending messages makes me make big nested if

For example:

if(Subject="something")
    do something
else if(subject="something else")
    do something else

How can I fix this?

  • 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-05-26T11:36:24+00:00Added an answer on May 26, 2026 at 11:36 am

    It all greatly depends on your application’s needs.
    Generally speaking: no, inventing your own protocol is not a good idea.

    There are quite a few ways to send messages from client to server.
    I’d suggest you to do some reading on WCF, or if you are in .NET 2.0 than .NET Remoting.
    Also, you might want to consider to send HTTP messages, as there are a shitload of frameworks to do that.

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

Sidebar

Related Questions

I have a client server application in which the server and the client need
I have a client server application in which I need to transmit a user
We have a Server/Client cybercafe management application which used to work fine on Windows
I want to create an application which will have a client and server components.
I am developing an application in C# WPF which will have Client-Server architecture (Client
I have a client-server Silverlight application, which is use Socets. I have server appliaction
I have a WPF application which so far has been client only, but now
I have existing video streaming application which is based client server technlogy. Existing system
I have an web application which logs all the activities perform by the client
I have a client-server java application, where communication happens over SSL. Right now I

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.