有谁用过金蝶的Apusic应用服务器,说说感受

有谁用过金蝶的Apusic应用服务器,说说感受,第1张

金蝶Apusic应用服务器60新特性
在金蝶Apusic应用服务器60旧有版本的基础上,金蝶Apusic应用服务器60具备了更多的新的特性和对以前特性的增强,情况如下。
对RIA(Rich Internet Application)的更全面支持
金蝶Apusic应用服务器60在JSF 12及标准EL的基础上作了重要扩充,在容器级别提供JSF 托管Bean与JPA实体、Spring Bean之间的双向注入管理,结合全球独创的OperaMasks SDK及一体化开发与管理环境OperaMasks Studio,真正实现基于Java EE技术RIA应用开发的全生命周期管理。
提供增强SOA基础设施
金蝶Apusic应用服务器60在50的基础上,进一步强化了SOA基础设施能力,实现对SCA/SDO技术的良好支持,并实现对第三方Web Services框架的良好兼容性,为面向SOA系统提供更为平滑的支撑能力。
实现增强的可靠性
金蝶Apusic应用服务器60不仅支持应用的垂直扩展和水平扩展,并且能够适应复杂环境下系统的扩展需求,提供配对算法、全复制算法等,实现对F5、Radware等硬件负载均衡设备及常规Web Server的全面兼容。
性能优化及提升
金蝶Apusic应用服务器60在50的基础上,进行了大量性能优化工作,包括静态资源缓存、NIO InputStream算法及长连接管理优化、>可以考虑将richtextBox里的内容在服务器端保存成一个文档,例如保存为WORD文档,WORD文档是可以同时存文字和的。数据库里只放地址。如果你非要把文字和都保存在数据库里,那就要看你用的是什么数据库了,用SQL或者ORACL或许还行,MYSQL也还可以。不过,即便是能够保存如此大的数据,读取起来也不是很方便,占用服务器资源太多。还是考虑保存成文件。另外还有一个方法,不用richtextBox,该用类似第三方的控件,比如:ewebediter什么的,都可以保存文字和。

好你要经过三次握手吧
-------------------------------socket_client
using System;
using SystemCollectionsGeneric;
using SystemComponentModel;
using SystemData;
using SystemDrawing;
using SystemText;
using SystemWindowsForms;
using SystemNet;
using SystemNetSockets;
using SystemThreading;
namespace socket_client
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
IPEndPoint end;
Socket s;
Thread td;
private void button1_Click(object sender, EventArgs e)
{
try
{
int port = Int32Parse(textBox2TextSubstring(textBox2TextLastIndexOf(":") + 1));
IPAddress ip = IPAddressParse(textBox1TextSubstring(textBox1TextLastIndexOf(":") + 1));
end = new IPEndPoint(ip, port);

}
catch
{
MessageBoxShow("输入有误!!");
textBox1Text = "IP:";
textBox2Text = "端口:";
return;
}
try
{
s = new Socket(AddressFamilyInterNetwork, SocketTypeStream, ProtocolTypeTcp);
sConnect(end);
label1Text = "成功联接上服务器 " + textBox1Text + ":" + textBox2Text;
td = new Thread(new ThreadStart(bb));
tdIsBackground = true;
tdStart();
}
catch
{
label1Text = "联接失败服务器!! ";
}

}
void bb()
{
while (true)
{

byte[] bb = new byte[1024];
int i= sReceive(bb); //接收数据,返回每次接收的字节总数
string removeMsg = EncodingUnicodeGetString(bb,0,i);

if (removeMsg == "cmd---exit")//收到的是退出通知
{
richTextBox1Text = "";
label1Text = "无连接";
DialogResult re=MessageBoxShow("服务器已经关闭\n\"确定\"后退出程序,\n\"取消\"继续停留!", "消息提示:", MessageBoxButtonsOKCancel, MessageBoxIconWarning);
MessageBoxShow(reToString());
if (re == DialogResultOK)
{
sendExit();//告诉服务器我退出了
ApplicationExit();
}
return;
}
richTextBox1AppendText(removeMsg) ;
richTextBox1ScrollToCaret();
}
}
private void button2_Click(object sender, EventArgs e)
{
string msg = "客户端说:" + richTextBox2Text+"\n";
richTextBox1AppendText(msg);
byte[] by = EncodingUnicodeGetBytes(msg);
sSend(by);
richTextBox2Text = "";
richTextBox2Focus();
richTextBox1ScrollToCaret();

}
void sendExit()
{
string msg = "cmd---exit";
byte[] by = EncodingUnicodeGetBytes(msg);
sSend(by);
}
}
}
-----------------------------------------------socket_server
using System;
using SystemCollectionsGeneric;
using SystemComponentModel;
using SystemData;
using SystemDrawing;
using SystemText;
using SystemWindowsForms;
using SystemNet;
using SystemNetSockets;
using SystemThreading;
namespace socket_server
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
label1Text = "监听端口" + DnsGetHostByName(DnsGetHostName())AddressList[0] + ":" + Int32Parse(textBox1TextSubstring(textBox1TextLastIndexOf(":") + 1)) + "中";
Thread td = new Thread(new ThreadStart(aa));
tdStart();
if (button1Text == "开始监听")
{
button1Text = "停止监听";

return;
}
else
{
sendExit();
ssShutdown(SocketShutdownBoth);
sClose();
tdAbort();
label1Text = "停止监听!";
richTextBox1Text = "";
button1Text = "开始监听";

}
}
void sendExit()
{
string msg = "cmd---exit";
byte[] by = EncodingUnicodeGetBytes(msg);
ssSend(by);
}
Socket s;
Socket ss;
void aa()
{

int port = Int32Parse(textBox1TextSubstring(textBox1TextLastIndexOf(":") + 1));

IPEndPoint end = new IPEndPoint(DnsGetHostByName(DnsGetHostName())AddressList[0], port);
s = new Socket(AddressFamilyInterNetwork, SocketTypeStream, ProtocolTypeTcp);
sBind(end);
sListen(5);
ss=sAccept();
if (ssConnected)
{
label1Text = "有客户端联接上端口:"+textBox1Text;
while (true)
{
byte[] by = new byte[1024];
int i = ssReceive(by);
string msg = EncodingUnicodeGetString(by, 0, i);
if (msg == "cmd---exit")
{
label1Text = "客户端已经取消连接!";
return;
}
richTextBox1AppendText(msg);
richTextBox1ScrollToCaret();
}
}

}
private void button2_Click(object sender, EventArgs e)
{
string m = "服务器说:" + richTextBox2Text + "\n";
richTextBox1AppendText(m);
byte[] by = EncodingUnicodeGetBytes(m);
ssSend(by);
richTextBox2Text = "";
richTextBox2Focus();
richTextBox1ScrollToCaret();
}
private void button3_Click(object sender, EventArgs e)
{
string w="123455";
MessageBoxShow(wSubstring(0));
}
}
}

socket-client
----------------------------------------------
using System;
using SystemCollectionsGeneric;
using SystemComponentModel;
using SystemData;
using SystemDrawing;
using SystemText;
using SystemWindowsForms;
using SystemNet;
using SystemNetSockets;
using SystemThreading;
namespace socket_client
{
//客户端
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
ControlCheckForIllegalCrossThreadCalls = false;

}
Socket s;//聊天用
Thread th;
//连接
private void button1_Click(object sender, EventArgs e)
{
//步骤1 配置远程服务器信息
IPEndPoint removeServer = new IPEndPoint(IPAddressParse(textBox1Text), intParse(textBox2Text));
//步骤2 创建套接字
s = new Socket(AddressFamilyInterNetwork, SocketTypeStream, ProtocolTypeTcp);
//步骤3 套接字连接远程服务器
sConnect(removeServer);
//步骤4 提示连接状态
if (sConnected)
{
label4Text = "连接服务器成功!";
//步骤5 循环接收服务器发来的消息
th = new Thread(new ThreadStart(BB));
thIsBackground = true;
thStart();
}
}
void BB()
{
while (true)
{
byte[] bb = new byte[1024];
int i= sReceive(bb); //接收数据,返回每次接收的字节总数
string removeMsg = EncodingUnicodeGetString(bb,0,i);
if (removeMsg == "CMD--EXIT")//收到的是退出通知
{
label4Text = "无连接";
DialogResult re=MessageBoxShow("服务器已经关闭\n\"确定\"后退出程序,\n\"取消\"继续停留!", "消息提示:", MessageBoxButtonsOKCancel, MessageBoxIconWarning);
MessageBoxShow(reToString());
if (re == DialogResultOK)
{
sendExit();//告诉服务器我退出了
ApplicationExit();
}
return;
}
richTextBox1AppendText(removeMsg+"\n") ;
richTextBox1ScrollToCaret();
}
}
//发送消息
private void button3_Click(object sender, EventArgs e)
{
string msg = "客户端:" + richTextBox2Text;
byte[] bb = EncodingUnicodeGetBytes(msg);
sSend(bb);
richTextBox2Text = "";
richTextBox2Focus();
}
//发送“客户端退出提示”
void sendExit()
{
string cmd = "CMD--EXIT";
byte[] bb = EncodingUnicodeGetBytes(cmd);
sSend(bb);
}
}
}
socket-server
--------------------------------------------------------------
using System;
using SystemCollectionsGeneric;
using SystemComponentModel;
using SystemData;
using SystemDrawing;
using SystemText;
using SystemWindowsForms;
using SystemNet;
using SystemNetSockets;
using SystemThreading;
namespace socket_server
{
//服务器
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
ControlCheckForIllegalCrossThreadCalls = false; //可以调试时,不捕捉控件创建线程错误
}
Thread th;
Socket s1;//监听用
Socket s2;//聊天用
//监听
private void button1_Click(object sender, EventArgs e)
{

IPAddress ip = DnsGetHostEntry(DnsGetHostName())AddressList[0];
//步骤1 创建网络端点IPEndPoint
IPEndPoint myServer = new IPEndPoint(ip, 888);
//步骤2 创建套接字Socket
s1 = new Socket(AddressFamilyInterNetwork, SocketTypeStream, ProtocolTypeTcp);
//步骤3 套接字绑定到网络端点
s1Bind(myServer);
label1Text = ip+": 888 \n等待客户端连接";
th = new Thread(new ThreadStart(AA));
thIsBackground = true;
thStart();
}
void AA()
{
//步骤4 监听
s1Listen(5);
//步骤5 接受客户端连接
s2 = s1Accept();
//步骤6 判断连接状态
if (s2Connected)
{
label1Text = "已有客户端连接!";
//步骤7 循环接收客户端消息
while (true)
{
byte[] bb = new byte[1024];
int i= s2Receive(bb);
string removeMsg = EncodingUnicodeGetString(bb,0,i);
if (removeMsg == "CMD--EXIT")//收到的是退出通知
{
label1Text = "客户端已经取消了连接";
return;
}
richTextBox1AppendText( removeMsg+"\n" );
richTextBox1ScrollToCaret();
}
}
}
//停止监听
private void button2_Click(object sender, EventArgs e)
{
sendExit();//告诉客户端
s2Shutdown(SocketShutdownBoth);
s1Close();
thAbort();
label1Text = "无连接";

}
//发送消息
private void button3_Click(object sender, EventArgs e)
{
string msg = "服务器:" + richTextBox2Text;
byte[] bb = EncodingUnicodeGetBytes(msg);
s2Send(bb);
richTextBox2Text = "";
richTextBox2Focus();
}
//发送“服务器退出提示”
void sendExit()
{
string cmd = "CMD--EXIT";
byte[] bb = EncodingUnicodeGetBytes(cmd);
s2Send(bb);
}
}
}

CentOS系统安装DNS服务器方法
DNS 安装配置
在 RHEL5、6 中 DNS 都是用的是 bind 软件包,而在 RHEL/CentOS 7 用的是 unbound 安装包,配置文件也有了改变。我们来看一下:
21安装:
代码如下:
[root@linuxprobe ~]# yum -y install unbound
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management You can use subscription-manager to register
Resolving Dependencies
---> Running transaction check
---> Package unboundx86_64 0:1420-19el7 will be installed
---> Finished Dependency Resolution
·····
启动服务
代码如下:
[root@linuxprobe ~]# systemctl restart unbound //启动DNS服务
[root@linuxprobe ~]# systemctl enable unbound
ln -s ‘/usr/lib/systemd/system/unboundservice‘ ‘/etc/systemd/system/multi-usertargetwants/unboundservice‘
//下次系统重启自动启动DNS服务
22修改配置文件
unbound 安装好之后,缺省配置文件在 /etc/unbound/unboundconf。
221修改端口监听地址
相当于 RHEL6 配置文件中的:listen-on port 53 { any; };
查看默认监听地址
代码如下:
[root@linuxprobe ~]# netstat -tunlp |grep unbound
tcp 0 0 127001:53 0000: LISTEN 3333/unbound
tcp 0 0 127001:8953 0000: LISTEN 3333/unbound
tcp6 0 0 ::1:53 ::: LISTEN 3333/unbound
tcp6 0 0 ::1:8953 ::: LISTEN 3333/unbound
udp 0 0 127001:53 0000: 3333/unbound
udp6 0 0 ::1:53 ::: 3333/unbound
//默认监听本地回环地址,也就是现在只有自己能访问DNS服务,其它主机不能访问本机的DNS服务
修改监听地址代码如下:
[root@linuxprobe ~]# vim /etc/unbound/unboundconf
……
38 # interface: 0000
39 interface: 0000
……
//找到38行,复制去掉注释行,打开监听全网功能。
重启服务查看
代码如下:
[root@linuxprobe ~]# systemctl restart unbound
[root@linuxprobe ~]# netstat -tunlp |grep unbound
tcp 0 0 0000:53 0000: LISTEN 3461/unbound
tcp 0 0 127001:8953 0000: LISTEN 3461/unbound
tcp6 0 0 ::1:8953 ::: LISTEN 3461/unbound
udp 0 0 0000:53 0000: 3461/unbound
//现在53号端口监听的是0000,即所有网段都监听。
222修改允许查询的范围
在 RHEL6 中,DNS 配置文件中有这样一句:allow-query { localhost; };。此句定义的是允许向本机查询(迭代 & 递归)的主机范围,localhost 代表只有本机可以向本机查询。而在配置中,经常改 localhost 为 any,让所有主机能够向本机查询 DNS。所以,在 RHEL7 中,也要做这样的修改,只不过修改内容不同而已,如下:
代码如下:
[root@linuxprobe ~]# vim /etc/unbound/unboundconf
……
177 # access-control: 0000/0 refuse
178 access-control: 0000/0 allow
179 # access-control: 127000/8 allow
……
找到配置文件/etc/unbound/unboundconf的第177行,缺省为注释行,把内容改为允许访问,然后保存退出,重启服务即可。
223创建解析文件
RHEL/CentOS 5、6系统中,DNS 的解析文件分正向和反向两个解析文件,并且有解析文件的模板文件。但是在 RHEL7中,正反向解析文件合并为一个,并且无模板文件,需自己创建,路径可以在主配置文件中查看:
代码如下:
[root@linuxprobe ~]# vim /etc/unbound/unboundconf
……
453 # You can add locally served data with
454 # local-zone: "local" static
455 # local-data: "mycomputerlocal IN A 1920251"
//正向解析可参考语法
456 # local-data: ‘mytextlocal TXT "content of text record"‘
457 #
458 # You can override certain queries with
459 # local-data: "adserverexamplecom A 127001"
460 #
461 # You can redirect a domain to a fixed address with
462 # (this makes examplecom, >

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zz/13446852.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-08-08
下一篇 2023-08-08

发表评论

登录后才能评论

评论列表(0条)

保存