Re: Who could tell me about raw socket in winsocket?
- From: "Remy Lebeau" <no.spam@xxxxxxxxxxx>
- Date: Mon, 11 May 2009 10:58:32 -0700
"Lee Tow" <fbjlt@xxxxxxxxxxxxx> wrote in message
news:ujOGjcI0JHA.1372@xxxxxxxxxxxxxxxxxxxxxxx
1 When we create a socket,socket(AF_INET,SOCK_RAW,protocol),
I want to know what the parameter protocol can be assigned in detail?
You need to set it to IPPROTO_RAW.
2 What is the parameter protocol related to,it is related to sending
data or receiving date?
It is what it says it is - the "protocol" within the "address family" (in
your case, the AF_INET family) that the socket will send/receive packets
for. For RAW sockets, there is no defined protocol. That is the whole
point of using a RAW socket - you are in full control over what protocol you
decide to implement.
For example,when the parameter protocol is assigned to IPPROTO_ICMP,
we send ICMP package or IP package when sending data?We receive ICMP
package or IP package when receiving data?
ICMP is a protocol. IPPROTO_ICMP only sends/received ICMP packets.
--
Remy Lebeau (TeamB)
.
- References:
- Who could tell me about raw socket in winsocket?
- From: Lee Tow
- Who could tell me about raw socket in winsocket?
- Prev by Date: Re: Sharing same local port in client UDP sockets
- Next by Date: RE: bluetooth and advertise the service
- Previous by thread: Who could tell me about raw socket in winsocket?
- Next by thread: good book with examples on c# socket programming
- Index(es):
Relevant Pages
|