Simple TCPClient/Listener ("hello world") example

Benjamin Jones

All I'm looking for is a simple TCPClient/Listener ("hello world") example. I'm a newbie and Microsoft TCPClient/Listener class examples are not what I am looking for. All I am looking is for the TCPClient to send a message "Hello world" and for a TCPListener to get the message and to send a message back "I got your hello world message"?

A little help would be great. All I have is the TCPClient sending out "Hello World". Would this work?

Dim port As Int32 = 13000
        Dim client As New TcpClient("192.168.0.XXX", port)
        ' Translate the passed message into ASCII and store it as a Byte array. 
        Dim data As [Byte]() = System.Text.Encoding.ASCII.GetBytes("Hello World")

    ' Get a client stream for reading and writing. 
    '  Stream stream = client.GetStream(); 
    Dim stream As NetworkStream = client.GetStream()

    ' Send the message to the connected TcpServer. 
    stream.Write(data, 0, data.Length)
Synaps3

These two tutorials should show you how to do it with the bare minimum. The first one is more aimed at what you want I think.

Try this: http://www.nullskull.com/articles/20020323.asp

Or this: http://www.codeproject.com/Articles/38914/A-TCP-IP-Chat-Program

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Prelink Error: prelink-cross: simple hello world example

From Dev

Simple Hello world with PegDown?

From Dev

Simple modification of Hello World

From Dev

Graphics driver "hello world" example?

From Dev

Spring hello world example error

From Dev

Hello world minitest cli example

From Dev

AngularJS simple "Hello, world" not working

From Dev

ClassNotFoundException on simple Hello World in IntelliJ

From Dev

Unable to run a simple hello world

From Dev

Is there a simple "Hello World" for making games?

From Dev

Unable to run a simple hello world

From Dev

Simple React Hello World Implementation

From Dev

Where can I find a Simple Hello World example for Ubuntu SDK (QT)?

From Java

MEDIAPIPE failed run hello world from example

From Dev

mithril hello world MVC example not working

From Dev

JointJS: Hello World example doesn't work

From Dev

How to get started with ReactJS Hello World example?

From Dev

Node.js Error for Hello World example

From Dev

"Hello World" in Openvms/Itanium assembly example?

From Dev

"Hello World" example for Slick 2.0 with MySQL

From Dev

CMake - Code::Blocks - hello world - basic example

From Dev

ServiceStack hello world example not generating soap proxies

From Dev

MVC using Spring hello world example

From Dev

Calling Methods In Java - Hello World Example

From Dev

AngularJS, $routeProvider and resolve: Hello World example not working

From Dev

How to get started with ReactJS Hello World example?

From Dev

redux-react simple hello world

From Dev

Knockout.js - simple "Hello World" fails

From Dev

Simple 'Hello World' type setup of TextAngular fails