Skip to content

Server responses are occasionally fragmented. #2

@Bigjango13

Description

@Bigjango13

I used the example simple-server and used this code to ping it:

import socket

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("localhost", 60))
s.sendall(b'\x00\x00')

data = b" "
while data != b"":
    data = s.recv(4096)
    print(data)

I received four different types of output.

b'\x00'
b'\x0f\x00\x00\x00\x00\x00\x00\x00Hello From "/"!'
b''
b'\x00\x0f\x00\x00\x00\x00\x00\x00\x00Hello From "/"!'
b''
b'\x00'
b'\x0f\x00\x00\x00\x00\x00\x00\x00'
b'Hello From "/"!'
b''
b'\x00\x0f\x00\x00\x00\x00\x00\x00\x00'
b'Hello From "/"!'
b''

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions