packet

SFML TCP packet receive

ぐ巨炮叔叔 提交于 2019-12-12 01:35:00
问题 I send a packet as client to server and I want to the server sends that packet forward to all client, here is the code: #include <iostream> #include <SFML/Network.hpp> using namespace std; int main() { int fromID; // receive data from 'fromID' int Message; // fromID's message sf::SocketTCP Listener; if (!Listener.Listen(4567)) return 1; // Create a selector for handling several sockets (the listener + the socket associated to each client) sf::SelectorTCP Selector; Selector.Add(Listener);

Java EOFException Server/Client TCP application

为君一笑 提交于 2019-12-11 18:12:05
问题 I am running 2 threads in my applciation. One to check for incoming packets and one to process and send packets. They both do it on the SAME STREAM. Example for 1: while (connection open) { in.readObject() instanceof ... } Example for 2: while (connection open) { processPacket(in) } I'm pretty sure EOFException is when the threads try and use the stream at the same time. It's not a constant EOF but only like every 1 second I get an EOF the rest works fine. So that's why I suspect that they

Kryonet client disconnects after send a packet to server (java)

主宰稳场 提交于 2019-12-11 18:03:05
问题 I'm doing a little MMO project and right now I'm working on the login/register system. Whenever I try to send a ClientLoginPacket, the client disconnects from the server and the packet is not received at all by the server. There is no stack trace that shows up but here is my code. Sorry it's a lot but it's all necessary: ClientLoginPacket.java: package net.vediogames.archipelo.networking.packets; import net.vediogames.archipelo.networking.Networking; public class ClientLoginPacket extends

Scapy: no reply on raw ICMP packet

99封情书 提交于 2019-12-11 06:58:45
问题 I've constructed a packet with scapy : a=IP(dst='192.168.0.1',proto=1)/'\x08\x00\xf7\xff\x00\x00\x00\x00' I run: send(a) Wireshark shows me that there is a ping request and ping response from 192.168.0.1 No warnings, all fields are correct But when I try: b=sr1(a) Then Scapy can't get an answer (Wireshark shows me again that there is request and reply) What can I do with it? 回答1: The problem is that scapy doesn't know how to recognize the response because you are honestly building an ICMP

Is there any library to manage TCP packets on Android? [closed]

自作多情 提交于 2019-12-11 02:34:49
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I am trying to make connection between my Python3 local LAN server script and my Android device. While testing i am using Android Virtual Device Manager. Main target is to keep connection between server and clients for a long time (1 hour). Is there any good library to send and receive packets for an Android and

Twisted Python: Max Packet Size? Flush socket?

风格不统一 提交于 2019-12-11 01:45:49
问题 I'm implementing a client-server solution based on Twisted for the server side and e.g. and Android phone for the client side. Because the Andoird emulator takes no TCP Packets larger then 1500b (or less?), I need to be able to chunk packets on the server side. Without flushing the socket after each "transport.write", Twisted buffers the outgoing data so the chunking would be useless without somekind of manual or automatic flushing / maxpacketsize function. How do I do this in Twisted? I'm

Get IP packet data from ByteBuffer

江枫思渺然 提交于 2019-12-11 01:41:03
问题 I'm trying to get the source and destination address from a packet. This is how i am reading the packet: private void debugPacket(ByteBuffer packet) { int buffer = packet.get(); int ipVersion = buffer >> 4; int headerLength = buffer & 0x0F; headerLength *= 4; buffer = packet.get(); //DSCP + EN int totalLength = packet.getChar(); //Total Length buffer = packet.getChar(); //Identification buffer = packet.getChar(); //Flags + Fragment Offset buffer = packet.get(); //Time to Live int protocol =

iOS remote virtual interface does not work

懵懂的女人 提交于 2019-12-11 01:37:26
问题 I want to capture the net traffic on my iPhone. So I followed the guid on the official site. Connect iOS device to the Mac via USB. $ rvictl -s UDID I saw the interface rvi0 via ifconfig -l. I used tcpdump to capture the packet: $ sudo tcpdump -i rvi0 -n tcpdump: WARNING: rvi0: That device doesn't support promiscuous mode (BIOCPROMISC: Operation not supported on socket) tcpdump: WARNING: rvi0: no IPv4 address assigned tcpdump: verbose output suppressed, use -v or -vv for full protocol decode

Endian issue with casting a packet to a struct

十年热恋 提交于 2019-12-11 00:59:23
问题 I'm using libtrace to parse network packets but am having, what I think is, an endian issue. Here is the libtrace definition of a Radiotap packet: typedef struct libtrace_radiotap_t { uint8_t it_version; /**< Radiotap version */ uint8_t it_pad; /**< Padding for natural alignment */ uint16_t it_len; /**< Length in bytes of the entire Radiotap header */ uint32_t it_present; /**< Which Radiotap fields are present */ } PACKED libtrace_radiotap_t; So I cast my libtrace_packet_t to this Radiotap

How to read a FSM diagram

拟墨画扇 提交于 2019-12-10 13:58:32
问题 How do i take this diagram and translate it into a useable program. I'm not really sure how to read this diagram. If someone could just kind of walk me through, maybe show an example of code and how it relates to the diagram, that be great. Thanks! 回答1: Circles with text inside are the states. Text describes what the state is. Dashed arrow points to starting state. Outgoing arrows determine where this state could change. Beside of the arrow is the text divided by the line into upper part and