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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:29:34+00:00 2026-06-07T20:29:34+00:00

I have this System.Net.Sockets.TcpClient . I can make a connection and write packets to

  • 0

I have this System.Net.Sockets.TcpClient. I can make a connection and write packets to it accurately. The problem is want to read the packets as it is (as caught by sniffers in the hex form like 0F 03 56 56 etc.)

I tried looking at examples of GetStream.write but I fail to read them in such way. I also tried using a streamreader then convert the packets to hex but the thing I connect to sends screwed up packets which can’t be converted or simple not in string form.

I hope I’m clear enough.

Dim bytes(tcpClient.ReceiveBufferSize) As Byte 
' Read can return anything from 0 to numBytesToRead. 
' This method blocks until at least one byte is read. 
netStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize)) 
' Returns the data received from the host to the console. 
Dim returndata As String = Encoding.ASCII.GetString(bytes) 
  • 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-07T20:29:37+00:00Added an answer on June 7, 2026 at 8:29 pm

    Found the solution! Here it is:

    Dim Bytes() as Byte = New Byte(1024){}
    Array.Resize(Bytes, TcpClient.Client.Receive(Bytes, SocketFlags.None))
    
    For Each B As Byte In Bytes
        Debug.Print("Byte in HEX Format: " & B.ToString("X2"))
    Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hi i have a socket connection (server) developed with methods available in using System.Net.Sockets;
I'm using TCPListener which according to this page should be in System.Net.Sockets, I have
I have this webdav code thats creating folders in SharePoint: HttpWebRequest request = (System.Net.HttpWebRequest)HttpWebRequest.Create(folderAddress);
I have a .NET application that contains a checkbox (System.Windows.Forms.Checkbox). This component (WindowsForms10.BUTTON.app.0.378734a1) is
I have a class that uses 'System.Net.Sockets.Socket' directly for network comunication, and currently I
I have some kind of problem and I can't check this at home if
I have a method that is asynchronously called when System.Net.Sockets.NetworkStream.BeginRead completes. skDelegate = New
I'm trying to use Moles to mock the Socket class in System.Net.Sockets. I have
using BouncyCastle and with help from a stackoverflow question I got this: using System.Net.Sockets;
I am implementing a small library to make the use of System.Net.Sockets.Socket easier. It

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.