Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
PHP restart script.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="NSA" data-source="post: 216125" data-attributes="member: 10034"><p>Hello,</p><p> </p><p>So I have a small script which opens up a port and listens for a message.</p><p> </p><p>[PHP]set_time_limit(0);</p><p>$address="192.168.0.2";</p><p>$port="3222";</p><p>$sock=socket_create(AF_INET,SOCK_STREAM,0) or die("Cannot create a socket");</p><p>socket_bind($sock,$address,$port) or die("Couldnot bind to socket");</p><p>socket_listen($sock) or die("Couldnot listen to socket");</p><p>$accept=socket_accept($sock) or die("Couldnot accept");</p><p>$read=socket_read($accept,1024) or die("Cannot read from socket");</p><p>echo $read;[/PHP]</p><p> </p><p>The problem is, upon receiving a message the webpage is stopped.</p><p>Which means the port is no longer available.</p><p>Is there anyway I can restart it?</p><p>I tried putting it all in a function and using goto but I can't get it working.</p><p> </p><p>Any help?</p></blockquote><p></p>
[QUOTE="NSA, post: 216125, member: 10034"] Hello, So I have a small script which opens up a port and listens for a message. [PHP]set_time_limit(0); $address="192.168.0.2"; $port="3222"; $sock=socket_create(AF_INET,SOCK_STREAM,0) or die("Cannot create a socket"); socket_bind($sock,$address,$port) or die("Couldnot bind to socket"); socket_listen($sock) or die("Couldnot listen to socket"); $accept=socket_accept($sock) or die("Couldnot accept"); $read=socket_read($accept,1024) or die("Cannot read from socket"); echo $read;[/PHP] The problem is, upon receiving a message the webpage is stopped. Which means the port is no longer available. Is there anyway I can restart it? I tried putting it all in a function and using goto but I can't get it working. Any help? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
PHP restart script.
Top