need IP address/port help

optiontips.in

New member
Joined
Apr 16, 2012
Messages
1
Programming Experience
Beginner
I have never worked with IP before, being in an industry where RS485 is still prevalent! However, I have a number of devices with known IP addresses/ports which I wish to poll and they will reply to me on a preset IP address/port.
Very simply, is there a simple way of sending small data packets to a specific IP address and receiving all data packets sent back to a specific port (the client ID is in the data anyway so I don't care where it came from and I do not care if the packets come back out of order etc. because the program will take care of this anyway so the TCP side of things is pretty much irrelevant). After 3 days of searching I have got nowhere, just going round in circles because the forums are swamped with tcpclient/tcplistener articles which is not what I'm after. Any tips/links (idiot guides :) ) for utilising the underlying Socket class, or simlilar, to acheive this would be much appreciated.
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,605
Location
Norway
Programming Experience
10+
TcpClient/Listener is just a wrapper for Socket+NetworkStream, and the easiest approach to sockets.
If protocol is request/response on same connection you can also use WebClient (or UdpClient) which is an even simpler abstraction level.
If protocol is request, then device initiates new connection back with "response", then you need Socket/TcpListener to listen for and accept that connection, either of the mentioned classes can be used to send socket data.

Anyway, MSDN Library has all the documentation and code samples, which you should read.
 
Top Bottom