Jump to content

Do something when a byte is received ?

- - - - -

  • Please log in to reply
2 replies to this topic

#1
Axel

Axel

    Newbie

  • Members
  • PipPip
  • 27 posts
I want to do something like , every time your computer receives a byte or uploads a byte , call a function. But I don't really know what I should google, what references I need to check

This could be an example
Private void ByteReceived(object sender,e as Eventargs)

{

MessageBox.Show("Zomg");

}


#2
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas
That's real vague. Can you be more specific about what you are trying to accomplish? Popping up a message every time your computer transmits or receives a byte wouldn't be very helpful since your computer transmits and receives millions of them each second. What's the overall goal you're trying to reach here?
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#3
fayyazlodhi

fayyazlodhi

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 403 posts
To elaborate a little there is a concept of ports in computers. A port is just a number (port 80 for web server), 21 for FTP etc.

Basically there are many different programs running on the pc talking to many different programs on the internet. To distinguish which messages is meant for whom, we have a port number e.g. your web browser (IE, Chrome, FF) sends an http request to google server when you type Google. on destination port 80 with the source port being some random value e.g. 4338. The response which contains destination port 4338 would be identified as destined to my browser and forwarded to it.

So each application running is bound to a different port number. Now which one are you interested in?
Today is the first day of the rest of my life




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users