;}///Client Input help command when output assistance information */if ($buf = = h) {$msg = "PHP Server help Message"."To quit, type quit."."To shut down the server type shutdown."."To get help message type Help."."Php>";Socket_write ($msgsock, $msg, strlen ($msg));Continue}/* Prompt message when the client input command does not exist */$talkback = "Php:unknow command $buf .php>";Socket_write ($msgsock, $talkback
($ buf )){Continue;}/* Close the client connection when the client enters the quit command */If ($ buf = 'Q '){Break;}/* When the client enters the shutdown command, both the server and client are closed */If ($ buf = 'shutdown '){Socket_close ($ msgsock );Break 2;}/* The client outputs help information when entering the help command */If ($ buf = 'h '){$ Msg = "PHP Server Help Message \ r \ n "."To quit, type 'quit'. \ r \ n "."To shut down the server type 'shutdown '. \ r \ n "."To get help m
:". Socket_strerror ($result). "\ n";
Break 2;
}
if (! $buf = Trim ($buf)) {
Continue
}/* Client input QUIT command when closing client connection */
if ($buf = = ' Q ') {
Break
}/* Client input Shutdown command when both server and client are off */
if ($buf = = ' shutdown ') {
Socket_close ($msgsock);
Break 2;
}///Client Input help command when output assistance information */
if ($buf = = ' h ') {
$msg = "PHP Server help Me
===$ buf ){
Echo "socket_read () failed: reason:". socket_strerror ($ result). "\ n ";
Break 2;
}
If (! $ Buf = trim ($ buf )){
Continue;
}/* Close the client connection when the client enters the quit command */
If ($ buf = 'Q '){
Break;
}/* When the client enters the shutdown command, both the server and client are closed */
If ($ buf = 'shutdown '){
Socket_close ($ msgsock );
Break 2;
}/* The client outputs help information whe
We know that data passing from parent to child is relatively easy, but it is more difficult to pass from a child process to a parent process.There are many ways to achieve process interaction, and in PHP it is more convenient to communicate in the pipeline. Of course, communication can also be done through Socket_pair.The first is the server in order to respond to every request to do things (send a URL sequence, url sequence with t split. And the end tag is N)function Clienthandle ($msgsock, $ob
First, open the socketPhpinfo (); Check to see if the socket extension is turned on, otherwise open in php.ini.Second, the server-side code of the wordingOb_implicit_flush (); $address = ' 127.0.0.1 '; $port = 10005;Creating portsif ($sock = Socket_create (Af_inet, sock_stream, sol_tcp) = = = =False) {echo "Socket_create () Failed:reason: ". Socket_strerror (Socket_last_error ()). "\ n ";}Bindingif (Socket_bind ($sock, $address, $port) = = =False) {echo "Socket_bind () Failed:reason: ". Socket_s
of code is the code in the program where I implement the communication:
1. 2. Set_time_limit (0);3. $address = "127.0.0.1";4. Ob_implicit_flush ();5./*6. * Created on 2009-9-147. *8. * To change the template of this generated file go9. * Window-preferences-phpeclipse-php-code Templates10. */11. $port = ' 8083 ';13. if ($sock = Socket_create (Af_inet, Sock_stream, sol_tcp)) echo "Socket_create () Failed:reason:". Socket_strerror ($sock). "\ n";16.}17. if ($ret = Socket_bind ($sock, $address, $p
[Go to] complete ArcGIS custom tool tutorial 1/2
I. Client -- Tag on the page:ClientAction = "EsriMapRectangle"ServerAction = "com. esri. adf. web. faces. event. ZoomInToolAction"ClientPostBack = "true"/>Ii. Client-clientActionClientAction refers to a javascript class, which must inherit EsriMapToolItem and overload several functions:Appendix 11. The first is: Object. inheritsFrom (Object parent), which is a function extension added by Esri to all js objects and used to inherit the parent class.
. activate ();} else {controller. deactivate () ;}}); // create an activation method controller for the controller. active = $. proxy (function () {this. trigger ("change", controller) ;}, this );}(Note) custom events in jQuery
The above Code focuses on bind and trigger. In jQuery, you can use these two methods to easily implement custom events:
Var $ obj =$ ({}); $ obj. bind ("myEvent", function () {console. log ("Custom Event") ;}; $ obj. trigger ("
Javascript class definition based on the OpenLayer toolbar management class
MapCwgisToolBarClass. js
// Define the toolbar management class // mapCwgisToolBarClass. js // vp: hsg // create date: 2013-07-31 // modify date: 2013-08-01 // defines the global variable var cmToolbar = null; // plug-in call method cmToolbar. addItem (pluginCmdTool); // defines the toolbar management class mapCwgisToolBarClass = OpenLayers. class ({// m_ToolBarItems: null, isScan: false, // initialization function init
fact, is to clear some of the boot cache files, as well as some useless information and files; 10, describes the role of the/ETC/RC.D/RC program 1, this step is based on the loaded run level to execute the run level corresponding to the program to determine which services to enable, for example, if the run The level value is 5 and will execute all programs in the/etc/rc.d/rc5.d/* directory to deactivate or start services that should be available
TFConda create-n Environment Name-c Mirror Source
1.2 Creating the Conda execution EnvironmentCreate a Conda environment called TensorFlow:
Python 2.7$ Conda create-n TensorFlow python=2.7
Python 3.4$ Conda create-n TensorFlow python=3.4
Python 3.5$ Conda create-n TensorFlow python=3.5
After the installation is complete, use the following command to activate \ Shutdown, Conda the execution environment.To activate the environment, use:
SOURCE Activate TensorFlowTo
the echo "socket_create () failure is:". Socket_strerror ($sock). " \ n ";
}
if ($ret = Socket_bind ($sock, $ip, $port))
The reason for the echo "Socket_bind () failure is:". Socket_strerror ($ret). " \ n ";
}
if ($ret = Socket_listen ($sock, 4))
The reason for the echo "Socket_listen () failure is:". Socket_strerror ($ret). " \ n ";
}
$count = 0;
do {
if ($msgsock = socket_accept ($sock))
echo "Socket_accept () F
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.