AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Packet sender tcp response data3/10/2023 ![]() There, you also have something like "packets", but those are independent of how many TCP or IP packets were required to send it underneath. It does so on top of TCP (or other transports) and adds more error correction for e.g. ZeroMQ you get a message-based interface that does all the transmission for you. In general, even using TCP is already relatively low-level and should be avoided unless really necessary. What you don't want to do is to create an implementation of TCP yourself, as that's a non-trivial task, so sending RAW packets is out. I honestly don't understand what you want to achieve with what you call "send packets". It also adds some error checking and error correction, so it is pretty reliable. The latter two are package-based, while TCP creates a stream of continuous bytes on top of it. This uses TCP, which is on top of IP and Ethernet. Socket.socket(socket.AF_INET, socket.SOCK_STREAM) already creates a connection that provides a reliable stream of bytes between two machines. Print 'Connected with ' addr ':' str(addr) Reply = 'Message Received at the server!\n' #infinite loop so that function do not terminate and thread do not end. Receving Data.\n') #send only takes string Error Code : ' str(msg) ' Message ' msgĬonn.send('Welcome to the server. S = socket.socket(socket.AF_INET, socket.SOCK_STREAM) HOST = '' # Symbolic name meaning all available interfaces ![]() #change the beginning time for measurement #if you got no data at all, wait a little longer, twice the timeout ![]() I would appreciate if someone could guide me in the right direction with explanation and some examples if possible.Īnyway here is the server/client script I'm running at the moment: I've looked at some examples, but as I don't have much experience in writing my own scripts/codes, I'm not very sure how to go about doing this. I was wondering, if it is possible to modify the scripts to send tcp data packets instead of purely text messages, as I would very much like to control the raspberry pi using my PC in the future without having the need to ssh/etc. Currently, the client is able to automatically send messages to the server. Recently, I managed to create sockets on my PC and my Raspberry Pi to enable communication between both devices.
0 Comments
Read More
Leave a Reply. |