C# tcp/ip 网络建立连接
来源:互联网 发布:gx48b控制卡软件 编辑:程序博客网 时间:2024/04/27 16:30
private bool ConnectToRemote()
{
bool p_rec = false;
WriteTextBox(txbRemote, "与 " + sSName + " P/D偿试通信连接中。。。");
try
{
remoteTcpClient.Connect(IPAddress.Parse(sRemoteHost), Int32.Parse(sRemotePort));
Thread.Sleep(500);
if (remoteTcpClient.Connected)
{
WriteTextBox(txbRemote, "与上级服务器 " + sSName + " 通信连接成功!");
RemoteIsConnected = true;
remoteNetStr = remoteTcpClient.GetStream();
p_rec = true;
}
else
{
txbRemote.Text += "与上级服务器 " + sSName + " 的连接已经断开!";
}
}
catch (Exception ex)
{
WriteTextBox(txbRemote, "与上级服务器 " + sSName + " 连接失败:" + ex.Message.ToString());
if (remoteTcpClient!=null)
{
remoteTcpClient.Close();
}
remoteTcpClient = new TcpClient();
}
return p_rec;
}
- C# tcp/ip 网络建立连接
- C#建立TCP/IP连接
- TCP/IP连接的建立
- TCP/IP连接的建立
- TCP/IP详解之 《网络协议》图解 TCP 连接建立与释放
- linux网络编程之TCP/IP基础:TCP连接的建立和断开、滑动窗口
- C# TCP/IP短连接
- C# TCP/IP网络编程
- TCP/IP的三次握手建立连接
- TCP/IP协议三次握手建立连接
- TCP/IP连接建立与断开
- 详解tcp/ip连接建立与释放
- TCP/IP (一) accept建立连接
- TCP/IP协议 --- 连接建立和终止
- TCP/IP 建立连接的过程
- TCP/IP——TCP建立连接与释放连接
- C#网络通信:TCP连接
- linux网络编程之TCP/IP基础(四):TCP连接的建立和断开、滑动窗口
- error C2061: 语法错误: 标识符“__RPC__out_xcount_part” VS2010
- servlet获取session值的纠结
- ZJNU 1614
- 实现业务系统中的用户权限管理--设计篇
- framebuffer驱动学习之代码分析
- C# tcp/ip 网络建立连接
- hdu2048
- Visual Studio 2010 Warning C4251 导出类中包含string成员
- Android通过http协议POST传输方式
- Android用GSon处理Json数据
- lingo学习笔记3
- 文件输入输出流->带缓冲的输入输出流(过滤流)->基本数据的输入输出流 链接 增强了文件输入输出流的功能
- 疯狂的 Web 应用开源项目
- Android的Location功能代码