socket接收数据问题,帮忙看看错处.

aivinok 2004-12-27 11:27:02
在客户机上发送:
this.senderSocket.Send(System.BitConverter.GetBytes((int)16));

服务器上接收:

while(true)
{
int returncount = TempSocket.Receive(buffer);

int type = ResolveByte(buffer, 0, 4);

Console.WriteLine("type={0}",type);
}

int ResolveByte(byte[] p_a,int p_Start,int p_End)
{
byte[] intbuffer = new byte[p_End-p_Start];

for(int i = p_Start;i<p_End;i++)
{
intbuffer[i] = p_a[i] ;
}

return System.BitConverter.ToInt32(intbuffer,0);

}

得到的结果是:
type=16
|>


为何多出一实心箭头在下一行.?????????
...全文
171 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
aivinok 2004-12-27
  • 打赏
  • 举报
回复
查出了.给分.
i三千 2004-12-27
  • 打赏
  • 举报
回复
up

111,098

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧