Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 17, 2017. It is now read-only.
This repository was archived by the owner on Aug 17, 2017. It is now read-only.

Socket API example (python) is not really a simple example on how to use sockets #4

@obeleh

Description

@obeleh

I would have expected something along the lines of:

import socket

size = 1024
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((MESSAGE_HUB_ADRESS, COMMAND_SERVER_PORT))
sock.send(message)
dataReceived = 'dummy'
total = ''
while dataRecieved != '':
    dataRecieved sock.recv(size)
    total += dataRecieved

But in the examples socket is not imported once.
Is there a reason for not showing how to use sockets?
An nntp example is perhaps also nice but rather step 2 or 3 instead of step 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions