Socket.SendTo()和headerincluded

时间:2012-09-12 07:37:14

标签: sockets tcp header packet

我使用套接字名称空间在两个系统之间建立连接,现在我能够发送和接收消息,现在我想获取有关已收到的数据包的信息,如标题信息(发送者地址,ttl和.. 。)

int sendCount = 1;// Number of times to send the response
int bufferSize = 4096;// Size of the send and receive buffers
IPAddress localAddress = IPAddress.Any;
SocketType sockType;
ProtocolType sockProtocol;
int rc;
Socket clientSocket;
byte[] receiveBuffer, sendBuffer;
Socket serverSocket = null;

1 个答案:

答案 0 :(得分:0)

您没有收到带TCP的数据包,您会收到字节流。

您可以从接受的套接字中获取发件人的远程地址和远程端口。

相信我,你根本不能得到一个你不想去的低层的TTL。