本文介绍了使用TcpListener和tcpClient进行套接字编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好, 顺应端口上可用的字节数. 当我们打电话给
Hello, supose there crore of byte avalable on a port. when we call
_client.Client.BeginReceive(_recieveBuffer, 0, 1024, SocketFlags.None, new AsyncCallback(OnBytesRecieved), null);然后我们说
and after it we say
_client.Client.EndRecieve()然后我们将一些字节存储在_recievBuffer中,可以了. 现在,如果下次再次调用
then we get some bytes stored in _recievBuffer its ok now if next time again calling
_client.Client.BeginReceive(_recieveBuffer, 0, 1024, SocketFlags.None, new AsyncCallback(OnBytesRecieved), null);和
TcpClient.Endrecieve()所以无论我们收到了什么,我都可以再次获得相同的数据吗??? 还是从头开始读取,并且在每个接收指针都移到下一个之后??
so here againt may i get same data whatever we have recieved????? or it stars reading from beginning and after each recieve pointer moved next??
推荐答案我认为有关CodeProject的这篇文章可以为您提供帮助: 使用C#的TCP/IP聊天应用程序 [ ^ ] 这是一篇有关网络编程的文章. Hi, I think this article on CodeProject can help you: TCP/IP Chat Application Using C#[^] It''s an article about network programming.
更多推荐
使用TcpListener和tcpClient进行套接字编程
发布评论