很简单的教程哦! 1.socket 简介 Socket 又称"套接字",应用程序通常通过"套接字"向网络发出请求或者应答网络请求.ServerSocket 用于服务器端,Socket 是建立网络连接时使用的.在连接成功时,应用程序两端都会产生一个 Socket 实例,操作这个实例,完成所需的会话. 2.ServerSocket 的建立与使用 最简单的建立服务器ServerSocket public class MyServerSocket { public stat
在连接mysql的时,经常会出现以下错误提示: ERROR (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' 出现此错误提示的原因一般有俩个: 一.mysql服务为启动 该sock文件是mysql启动的时候创建的,弱服务关闭,该文件消失. 判断mysql是否正常启动有俩个方法: 方法一: [root@localhost ~]# ps -ef | grep mysql Ap
1.workerman安装 workerman是php的一个socket框架,简化了socket编程,已经为很多企业所用,今天在centos的ngix+php下安装了workerman,过程记录如下. 官网上给的教程 但是我已经安装了php环境,所以跳过上面的1,2,3,4步骤,直接下载workerman的zip包,进行第5步安装. 进入workerman的目录进行安装如下.提示错误 [root@localhost server]# ls mysql nginx-1.4.4 phpredis w
string pack ( string $format [, mixed $args [, mixed $... ]] ) Pack given arguments into a binary string according to format. The idea for this function was taken from Perl and all formatting codes work the same as in Perl. However, there are some fo