Read incoming data form a port
hi every one can any one pls help me with reading incoimg data of the port
i thought the code was
VB Code:
sock.IOControl(IOControlCode.DataToRead, byt, bytes)
sock.BeginReceive(Bufferdata, 0,bufferdata.Length, SocketFlags.None, New AsyncCallback(AddressOf OnReceive), Nothing)
error
VB Code:
Message = "The system detected an invalid pointer address in attempting to use a pointer argument in a call"
any help would be helpfull
Re: Read incoming data form a port
Hi there,
Im not 100% clear about your goal here, which of the following applies?
1. You want to open a port and let something connect, read the data and possibly send something back.
or
2. You want to read data coming into a port that is already in use, and was not opened by your program. IE you want to make a packet sniffer?
Re: Read incoming data form a port
Quote:
2. You want to read data coming into a port that is already in use, and was not opened by your program. IE you want to make a packet sniffer?
is the exact thing I am trying to do for more than 2 days
thx for future help
Re: Read incoming data form a port
Have a look at this, its a contest winner
http://www.pscode.com/vb/scripts/Sho...4090&lngWId=10
Its not only a packet sniffer, but the guy has created a library, so people can just use the library to sniff the packets, I havent tested it but you should be able to have it read the data from a specific port on whatever protocol you choose such as TCP or UDP
There is another one here:
http://www.pscode.com/vb/scripts/Bro...1=Quick+Search
Re: Read incoming data form a port
yeah I will take a look at it thx
Re: Read incoming data form a port
Quote:
Originally Posted by the182guy
i've tryed those before but they dont work.
Re: Read incoming data form a port
@high6 are you using vb6 or .net?
Re: Read incoming data form a port
I use .net And i doesn't work for me
Re: Read incoming data form a port
Any one tryed winpcap before ??
if U did pls explain to me how to use them in vb.net