socket 通信例子public void send() { while (true) { string sql="select top 100 * from send"; SqlDataReader datareader =sqlserver
ExecuteSqlDataReader(sql); if (datareader
HasRows) //有记录才进行网关联接 { string show; string host; //int port =Convert
ToInt16("8801"); //host = Dns
GetHostName(); //host = "192
110"; socket temp=new socket(); Socket send=temp
connectSocket(this
remote_ip,this
remote_port); if (send == null) { this
send_listbox("打开远程 SMG 失败"); } else { this
send_listbox("打开远程 SMG 成功"); byte[] bind_content=sgip_test
bind(count); count_step(); byte[] receive=new byte[256]; byte flag; send
Send(bind_content,bind_content
Length,0); //bind send
Receive(receive,29,0); //bind_resp 读取 29 位 flag=sgip_test
bind_resp_result(receive); if (flag==0) this
send_listbox("成功联接到网关"); else this
send_lis