02-20-2012
i think so too. However, the broker does read the packet the first time, and retrieves the mosq->id field which is set to "publisher". That's why it gives the error:
Socket read error on client "publisher", disconnecting.
if the packet was not valid, do you think it would access the field 'id' in the struct mosq sent over in the packet?
previously, when i was sending completely invalid packets, it would give the error:
Socket read error on client null, disconnecting.
So, is my packet reeally invalid? or is there some other reason?
9 More Discussions You Might Find Interesting
1. IP Networking
Command terminated with signal SIGSEGV. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").
while running our own program in ns3 we got the above error...
what does this error mean?? (1 Reply)
Discussion started by: nivedita
1 Replies
2. IP Networking
i need materials regarding ns3(related to WiMAX) (1 Reply)
Discussion started by: nivedita
1 Replies
3. IP Networking
how to add a relay node in wimax network using ns3 simulator.... (0 Replies)
Discussion started by: nivedita
0 Replies
4. IP Networking
Hi,
I am working to implement a basic WiFi infrastructure in NS3. I have placed 16 APs in grid and one client is moving using random walk. Client and AP can communicate through message exchange. However, when I try a message of size more than 30 bytes, it is crashed. Please help me if anyone have... (0 Replies)
Discussion started by: dandapat
0 Replies
5. UNIX for Dummies Questions & Answers
Hi, I'm doing my thesis on the NS3 environment. I need to integrate it with mqtt. Mqtt provides a (mosquitto) broker / server, and it expects to have clients connect to it. A client could be a publisher (publishes data on the broker) or a subscriber (receives data from the broker it has subscribed... (0 Replies)
Discussion started by: KishIsrael
0 Replies
6. IP Networking
Dear all,
I want to simulate an Wireless Mobile ad hoc network that uses the
OLSR routing algorithm. ( i know how to do that now after reading the
tutorial)
Now, Instead of sending messages, I want the nodes to be able to send
a c++ code.
consider this scenario:
node A, send a c++... (0 Replies)
Discussion started by: knowledgeSeeker
0 Replies
7. Infrastructure Monitoring
After setting up MQTT and testing some ESP8266 and ESP32 modules, where I noted that testing in Programming ESP32 (ESP-WROOM-32) as an MQTT Client Subscribed to Linux Server Load Average Messages, I was so impressed with MQTT that I installed MQTT on three different computers, instantly and... (2 Replies)
Discussion started by: Neo
2 Replies
8. Programming
Various Node-Red crypto modules do not work with PHP, so to send an encrypted message from a PHP script (in this case from a Ubuntu server) to Node-RED we need our own code.
After a few hours of searching, testing various libs, more testing and debugging, I got this PHP to Node-RED code... (0 Replies)
Discussion started by: Neo
0 Replies
9. Programming
First, I want to thank Neo (LOL) for this post from 2018, Node.js and mysql - ER_ACCESS_DENIED_ERROR
I could not get the Node-RED mysql module to work and searched Google until all my links were purple! I kept getting ER_ACCESS_DENIED_ERROR with the right credentials. Nothing on the web was... (0 Replies)
Discussion started by: Neo
0 Replies
LEARN ABOUT DEBIAN
pcap_next
PCAP_NEXT_EX(3PCAP) PCAP_NEXT_EX(3PCAP)
NAME
pcap_next_ex, pcap_next - read the next packet from a pcap_t
SYNOPSIS
#include <pcap/pcap.h>
int pcap_next_ex(pcap_t *p, struct pcap_pkthdr **pkt_header,
const u_char **pkt_data);
const u_char *pcap_next(pcap_t *p, struct pcap_pkthdr *h);
DESCRIPTION
pcap_next_ex() reads the next packet and returns a success/failure indication. If the packet was read without problems, the pointer
pointed to by the pkt_header argument is set to point to the pcap_pkthdr struct for the packet, and the pointer pointed to by the pkt_data
argument is set to point to the data in the packet. The struct pcap_pkthdr and the packet data are not to be freed by the caller, and are
not guaranteed to be valid after the next call to pcap_next_ex(), pcap_next(), pcap_loop(), or pcap_dispatch(); if the code needs them to
remain valid, it must make a copy of them.
pcap_next() reads the next packet (by calling pcap_dispatch() with a cnt of 1) and returns a u_char pointer to the data in that packet.
The packet data is not to be freed by the caller, and is not guaranteed to be valid after the next call to pcap_next_ex(), pcap_next(),
pcap_loop(), or pcap_dispatch(); if the code needs it to remain valid, it must make a copy of it. The pcap_pkthdr structure pointed to by
h is filled in with the appropriate values for the packet.
RETURN VALUE
pcap_next_ex() returns 1 if the packet was read without problems, 0 if packets are being read from a live capture, and the timeout expired,
-1 if an error occurred while reading the packet, and -2 if packets are being read from a ``savefile'', and there are no more packets to
read from the savefile. If -1 is returned, pcap_geterr() or pcap_perror() may be called with p as an argument to fetch or display the
error text.
pcap_next() returns a pointer to the packet data on success, and returns NULL if an error occurred, or if no packets were read from a live
capture (if, for example, they were discarded because they didn't pass the packet filter, or if, on platforms that support a read timeout
that starts before any packets arrive, the timeout expires before any packets arrive, or if the file descriptor for the capture device is
in non-blocking mode and no packets were available to be read), or if no more packets are available in a ``savefile.'' Unfortunately,
there is no way to determine whether an error occurred or not.
SEE ALSO
pcap(3PCAP), pcap_geterr(3PCAP), pcap_dispatch(3PCAP)
5 April 2008 PCAP_NEXT_EX(3PCAP)