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 1067895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:12:59+00:00 2026-05-16T20:12:59+00:00

My application in c# wants to cominicate with 3rd party Tcp server to send

  • 0

My application in c# wants to cominicate with 3rd party Tcp server to send data and recieve back response messages …The syntax of commands has UShort,ULONG,BYTE type datas
a sample command that needed to send by my app is

USHORT 0xFFFF
USHORT 0x00D0
BYTE   0xDD

then in app i send data as

  TcpClient tcpClient = new TcpClient();
       tcpClient.Connect("XX.XX.XX.XX",portnumber);

       Networkstream ns=tcpClient.GetStream();
       StreamWriter sw=new StreamWriter(ns);
       sw.Write(0xFFFF);
       sw.Write(0x00DD);
       sw.Write(0x00);

//or send them bytes

     sw.Write(0xFF);
       sw.Write(0xFF);
       sw.Write(0x00);
       sw.Write(0xD0);
       sw.Write(0x00);
       sw.Write(0x00);

and I read incoming messages over server as

  while (true)
               {

                    byte[] buff=new byte[tcpClient.ReceiveBufferSize];
                    ns.Read(buff, 0, tcpClient.ReceiveBufferSize);
                 string dv= BitConverter.ToString(buff));
                }
//returned data looks like FF-A2-00-23-00-02-00-00-00-00-00-00-D9-2E-20-2E-00-A0-04-00-AE-08
//yes i know this byte syntaxes but returning data is not that i look response for command that i sent..

but returning values are not that i look for
Is there any wrong on my code with sending data to server??
and any recomendations on reading writing datas are welcome…

  • 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-16T20:12:59+00:00Added an answer on May 16, 2026 at 8:12 pm

    Nobody can tell you what’s wrong with the response when they don’t know the protocol employed. The server’s sending that because it feels like it… it might be something wrong with your request, or it might be a message indicating that it’s offline for service. You can only check it’s specification on how to interpret the result it did send, or ask the people who maintain it.

    Might also be a good idea to tag this question with the language you’re using, so people can make sense of the function calls and whether you’re invoking them properly.

    I’d also recommend using a packet sniffer (or on Linux simply strace) to show the packets being read and written… you will probably see the mistakes there. Then, use another program to interact with the server that does work, and compare bytes.

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

Sidebar

Related Questions

Use case: 3rd party application wants to programatically monitor a text file being generated
I have a client that wants the application to be able to send SMS
A client wants me to do some maintenance work to a VB 6.0 application
I use Indy 9 with Delphi 5. In my application I want to communicate
in my application i want to support both mass memory and memory card. but
In a Java application I want to be able to take a timestamp at
I have a ClickOnce deployed application I want to launch from VBScript, similar to
I have a .net (3.5) WinForms application and want to display some html on
I'm trying to get tags working in my rails application and want to use
On Gnome/KDE you can select in which application you want to open file (Right

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.