Click here to Skip to main content
15,888,600 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
How to send messages to an IP Address or MAC Address in a stream.

The project is that I want to send commands to a wireless plane by using my local pc from wireless network card because I make a ciruit in the plane to accept command via WiFi. I use ping to show if there is a connection. If the ping gives a reply I want to send a command called Aviation and another command.

If you please help me,
Thanks
Posted
Updated 15-May-12 10:02am
v2
Comments
Ed Nutting 15-May-12 16:05pm    
Edit of question: Improved English/grammar to make the question clearer (did my best guess as to what OP meant) so it makes sense now and sounds like a vaguely sensible question.

In response to OP, where exactly are you stuck? Have you managed to get a WiFi connection and ping working? Is it the code for doing the message sending that you are having a problem with? Try looking at TCP connections/streams - this should be what you need.

Hope this helps,
Ed

1 solution

Send message? This is not exactly how it works. You can send a message only if there is something listening to the message, some other code. Basically, I would advise to use TPC transport. In this case, one side is called server side and listens to incoming connection and another part is called a client part; it connects to the channel using IP address or its equivalent and the IP port. Of course, the same application can play a role of server or a client at the same time, as it can use several threads and channels. A server part needs at least two network threads: one listening for new connections, another one reading/writing from/to network streams.

There are several levels of networking you can use. I provided my short overview of them in my past answers:
how i can send byte[] to other pc[^],
Communication b/w two Windows applications on LAN.[^].

You can get general ideas of the architecture from my past answer:
Multple clients from same port Number[^].

—SA
 
Share this answer
 
Comments
Maciej Los 15-May-12 16:32pm    
Good answer and links ;) 5!
Sergey Alexandrovich Kryukov 15-May-12 17:28pm    
Thank you,
--SA
headlinear 30-May-12 15:53pm    
Thanks a lot BW for you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900