Hi,
I am new in this forum and php as well. I am familiar with (php?getdata=data) type format, but don't know how it connects in TCP/IP layer to receive tcp packets.
My embedded device sends data (in fixe format) using TCP protocol. I can only set server IP address, port number and TCP or UDP. I want to receive that data in my web server and store in mysql database.
Now my questions are -
1. Is it possible to receive data using php? if it is then how can I receive that data using php?
2. Do I need static IP to receive data? Or I can do it using shared hosting? How?
3. Is it possible to receive tcp data packet using port 80? how?
Please advise me what to do to receive TCP data packets using php. If possible then please refer some examples of similar types of data send/receive php codes.
Thanks in advance.
Receive TCP data packets in php
Moderator: General Moderators
-
darklord18
- Forum Newbie
- Posts: 8
- Joined: Sun Jun 08, 2008 7:57 pm
Re: Receive TCP data packets in php
Hello! I not a great expert, but you can do that with the socket. You will have to open up a socket to listen to any request.
you can check this out:
http://www.devshed.com/c/a/PHP/Socket-P ... ith-PHP/1/
It may help you!
The problem that i am facing is how to make it always run without opening a page.
I think this should be done by using the CLI, but how??
And what is the PHP binary???
you can check this out:
http://www.devshed.com/c/a/PHP/Socket-P ... ith-PHP/1/
It may help you!
The problem that i am facing is how to make it always run without opening a page.
I think this should be done by using the CLI, but how??
And what is the PHP binary???
Re: Receive TCP data packets in php
Hi,
Thanks for the link. I was wondering when there are several hundred of users will connect by TCP and send data in every minute continuously then how can I manage that? Should I keep the listening socket open forever? Or everytime close and open? How will it handle hundreds of data continuously?
Please advise me how to solve the problem.
Thank you.
Thanks for the link. I was wondering when there are several hundred of users will connect by TCP and send data in every minute continuously then how can I manage that? Should I keep the listening socket open forever? Or everytime close and open? How will it handle hundreds of data continuously?
Please advise me how to solve the problem.
Thank you.