On Sat, 19 Feb 2022 at 05:47, UTKARSH PANDEY wrote:
>
> On Wednesday, August 8, 2012 at 8:37:33 PM UTC+5:30, lipska the kat wrote:
> > ...
> Directly read bytes from file and send it over the socket object from client
> side in while loop until all content from file is read.
&
> Lipska the Kat: Troll hunter, sandbox destroyer
> and farscape dreamer of Aeryn Sun
Directly read bytes from file and send it over the socket object from client
side in while loop until all content from file is read.
Something like this.
Client side
import socket
s = socket.socket
n doesn't say so.
I've noticed that when the server is not running, logging.SocketHandler creates
the socket. I don't understand why it would; isn't it the server's job to
create the socket?
## CLIENT ####
import socket
import pic
Chris Angelico wrote:
>
> Hmm, your formatting's messed up, but the code looks fine to me. (Be aware
> that you seem to have a "selr" where it should be "self".)
Didn't catch that because my program didn't even get to that point ;-)
>
>> Howev
On Mon, Mar 22, 2021 at 9:11 PM Robert Latest via Python-list
wrote:
>
> Hello,
>
> I'm trying to set up a server that receives data on a Unix domain socket using
> the code below.
>
> import os from socketserver import UnixStreamServer, StreamRequestHandler
>
Hello,
I'm trying to set up a server that receives data on a Unix domain socket using
the code below.
import os from socketserver import UnixStreamServer, StreamRequestHandler
SOCKET = '/tmp/test.socket'
class Handler(StreamRequestHandler):
def handle(self): data = selr.rfi
On 11/18/19 9:23 PM, lampahome wrote:
As title, I tried to communicate with kernel via netlink. But I failed when
I receive msg from kernel.
The weird point is sending successfully from user to kernel, failed when
receiving from kernel.
So I want to check code in 3rd library and dig in, but alw
As title, I tried to communicate with kernel via netlink. But I failed when
I receive msg from kernel.
The weird point is sending successfully from user to kernel, failed when
receiving from kernel.
So I want to check code in 3rd library and dig in, but always found library
called netlinkg but it
On Wed, 2 Oct 2019 04:27:14 + (UTC)
Hongyi Zhao wrote:
> Hi,
>
> See my following test:
>
> With ipython:
>
> In [1]: import
> socket
>
> In [2]: socket.gethostbyname
> ('www.vpngate.net
On Wed, Oct 2, 2019 at 4:41 PM Hongyi Zhao wrote:
>
> On Wed, 02 Oct 2019 16:28:40 +1000, Chris Angelico wrote:
>
> > When you ask dig, you are always asking for a DNS lookup. But
> > gethostbyname does a lot of other things too.
>
> What other things, could you please give more detailed hints?
S
On Wed, 02 Oct 2019 16:28:40 +1000, Chris Angelico wrote:
> When you ask dig, you are always asking for a DNS lookup. But
> gethostbyname does a lot of other things too.
What other things, could you please give more detailed hints?
> My guess is that your
> /etc/hosts has an entry for that doma
On Wed, Oct 2, 2019 at 2:31 PM Hongyi Zhao wrote:
>
> Hi,
>
> See my following test:
>
> With ipython:
>
> In [1]: import
> socket
>
> In [2]: socket.gethostbyname
> ('www.vpngate.net')
> Out[2]: '130.158.75.44'
>
>
> With
Hi,
See my following test:
With ipython:
In [1]: import
socket
In [2]: socket.gethostbyname
('www.vpngate.net')
Out[2]: '130.158.75.44'
With dig:
$ dig www.vpngate.net @11
our data
centers.
Also, I am using commands module to get the traceroute output.
out = commands.getstatusoutput('traceroute ' + ip)
However I observe that this particular line is failing with socket error
after I reach some 5k to 6k hosts.
[...]
In fact, given that it is file d
centers.
>>Also, I am using commands module to get the traceroute output.
>>
>>out = commands.getstatusoutput('traceroute ' + ip)
>>
>>However I observe that this particular line is failing with socket error
>>after I reach some 5k to 6k hosts.
>>I
commands module to get the traceroute output.
out = commands.getstatusoutput('traceroute ' + ip)
However I observe that this particular line is failing with socket error
after I reach some 5k to 6k hosts.
I know commands module is using pipes to execute the given command and this
is one
Hi Shakti
You wrote:
> out = commands.getstatusoutput('traceroute ' + ip)
The page
https://docs.python.org/3/library/subprocess.html#legacy-shell-invocation-functions
describes subprocess.getstatusoutput as one of the "legacy functions from the
2.x commands module. These operations implicitly
e traceroute output.
>out = commands.getstatusoutput('traceroute ' + ip)
>However I observe that this particular line is failing with socket error
after I reach some 5k to 6k hosts.
>I know commands module is using pipes to execute the given command and
this is one reason for exhau
.
out = commands.getstatusoutput('traceroute ' + ip)
However I observe that this particular line is failing with socket error
after I reach some 5k to 6k hosts.
I know commands module is using pipes to execute the given command and this
is one reason for exhaustion of file descri
On Oct 3, 2018, Ian Kelly wrote
(in
article):
> On Wed, Oct 3, 2018 at 7:47 AM Russell Owen wrote:
> > Using asyncio I am looking for a simple way to await multiple events where
> > notification comes over the same socket (or other serial stream) in
> > arbitrary
> >
On Wed, Oct 3, 2018 at 7:47 AM Russell Owen wrote:
> Using asyncio I am looking for a simple way to await multiple events where
> notification comes over the same socket (or other serial stream) in arbitrary
> order. For example, suppose I am communicating with a remote device that
Hello Russell,
On 03/10/2018 15:44, Russell Owen wrote:
> Using asyncio I am looking for a simple way to await multiple events where
> notification comes over the same socket (or other serial stream) in arbitrary
> order. For example, suppose I am communicating with a remote device
Using asyncio I am looking for a simple way to await multiple events where
notification comes over the same socket (or other serial stream) in arbitrary
order. For example, suppose I am communicating with a remote device that can
run different commands simultaneously and I don't know
Antoon Pardon writes:
> This is on a debian 9 box python 2.7.13
>
> My interpretation is that a timeout exception is thrown and that the
> args attribute of such an exception is an empty tuple which then causes
> an IndexError in line 482 of module /usr/lib/python2.7/socket.py. Does
> that soundpl
https://mail.python.org/pipermail/python-list/2016-February/703154.html
On Thu, Mar 8, 2018 at 8:09 PM, Antoon Pardon wrote:
> This is on a debian 9 box python 2.7.13
>
> My interpretation is that a timeout exception is thrown and that the
> args attribute of such an exception is an empty tuple w
This is on a debian 9 box python 2.7.13
My interpretation is that a timeout exception is thrown and that the
args attribute of such an exception is an empty tuple which then causes
an IndexError in line 482 of module /usr/lib/python2.7/socket.py. Does
that soundplausible?
Here is the traceback:
716 kb
>> > ...
>> > self.sock.send(l)
>>
>> Please read the documentation for *send* in the "socket" module:
>> it tells you that "send" (in contrast to "sendall") is *not* guarantied
>> to send the complete *l* (there is no g
gt;
> Please read the documentation for *send* in the "socket" module:
> it tells you that "send" (in contrast to "sendall") is *not* guarantied
> to send the complete *l* (there is no guarantee how much is sent);
> the return value of "send" tells
bingbong3...@gmail.com writes:
> how much client can i handel whit this code what the amount of client that i
> can handel
> the size of the file is 716 kb
> ...
> self.sock.send(l)
Please read the documentation for *send* in the "socket" module:
it tells you that "
how much client can i handel whit this code what the amount of client that i
can handel
the size of the file is 716 kb
import socket
from threading import Thread
from SocketServer import ThreadingMixIn
##
TCP_IP = ''
TCP_PORT = 3156
BUFFER_SIZE = 1024
class ClientThread(Thread):
de
Hello,
�
I have a tcp server coded with python and my packets include a 2 bytes header
which is just the length of the following data. The problem is how can I be
sure I received 2 bytes and not just one byte. In Qt, I use bytesAvailable
function. However, here I just use sock.recv(2) but it can
On 01/23/2017 09:00 AM, Grant Edwards wrote:
On 2017-01-23, Antoon Pardon wrote:
The standard response to issues like this is:
A foolish consistency is the hobgoblin of little minds
And wise consistency is the foundation of a good language design.
Otherwise known as: if there's not a
On 2017-01-23, Antoon Pardon wrote:
> Op 22-01-17 om 01:52 schreef Grant Edwards:
>> Newsgroups: gmane.comp.python.general
>> From: Grant Edwards
>> Subject: Re: How to create a socket.socket() object from a socket fd?
>> References:
>>
>>
>> Fol
Op 22-01-17 om 01:52 schreef Grant Edwards:
> Newsgroups: gmane.comp.python.general
> From: Grant Edwards
> Subject: Re: How to create a socket.socket() object from a socket fd?
> References:
>
>
> Followup-To:
>
>
>
> I'm still baffled why the sta
gt;> The module correctly detects address family, socket type and proto from
>> a fd. It works correctly with e.g. IPv6 or Unix sockets. Ticket
>> https://bugs.python.org/issue28134 has additional background information
>> on the matter.
>
> Yes, thanks!
>
> Ju
Newsgroups: gmane.comp.python.general
From: Grant Edwards
Subject: Re: How to create a socket.socket() object from a socket fd?
References:
Followup-To:
I'm still baffled why the standard library fromfd() code dup()s the
descriptor.
According to the comment in the CPython sources
On 2017-01-21, Christian Heimes wrote:
> You might be interested in my small module
> https://pypi.python.org/pypi/socketfromfd/ . I just releases a new
> version with a fix for Python 2. Thanks for the hint! :)
>
> The module correctly detects address family, socket type and pr
On 2017-01-21, Chris Angelico wrote:
> On Sun, Jan 22, 2017 at 9:41 AM, Grant Edwards
> wrote:
>> | __init__(self, family=2, type=1, proto=0, _sock=None)
>> |
>>
>> Ah! There's a keyword argument that doesn't appear in the docs, so
>> let's try that...
>
> That's marginally better than my monke
Grant Edwards wrote:
> Given a Unix file discriptor for an open TCP socket, I can't figure
> out how to create a python 2.7 socket object like those returned by
> socket.socket()
>
> Based on the docs, one might think that socket.fromfd() would do that
> (since the docs
On 2017-01-21 23:41, Grant Edwards wrote:
> On 2017-01-21, Grant Edwards wrote:
>
>> Given a Unix file discriptor for an open TCP socket, I can't figure
>> out how to create a python 2.7 socket object like those returned by
>> socket.socket()
>>
>>
On Sun, Jan 22, 2017 at 9:41 AM, Grant Edwards
wrote:
> | __init__(self, family=2, type=1, proto=0, _sock=None)
> |
>
> Ah! There's a keyword argument that doesn't appear in the docs, so
> let's try that...
That's marginally better than my monkeypatch-after-creation
suggestion, but still broad
On 2017-01-21, Grant Edwards wrote:
> Given a Unix file discriptor for an open TCP socket, I can't figure
> out how to create a python 2.7 socket object like those returned by
> socket.socket()
>
> Based on the docs, one might think that socket.fromfd() would do that
> (si
On Sun, Jan 22, 2017 at 9:28 AM, Grant Edwards
wrote:
> Given a Unix file discriptor for an open TCP socket, I can't figure
> out how to create a python 2.7 socket object like those returned by
> socket.socket()
I suspect you can't easily do it. In more recent Pythons, yo
Given a Unix file discriptor for an open TCP socket, I can't figure
out how to create a python 2.7 socket object like those returned by
socket.socket()
Based on the docs, one might think that socket.fromfd() would do that
(since the docs say that's what it does):
Quoting https://docs.
use
> client:
> server_address='192.168.2.2'
server:
> server_name='127.0.0.1'
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, 22 Jul 2016 06:52 pm, Yubin Ruan wrote:
> Hi,
> I'm migrating my code to python3 now and find it hard to deal with
> python's 'str' and 'bytes' type. It's kind of painful. One thing I
> find really confusing is that, writing to
"Yubin Ruan" wrote in message
news:47f3acf9-8da2-4aad-a6f0-7a9efbdfe...@googlegroups.com...
In my understanding, writing to a file would requires that everything be
written byte by byte. So writing objects of type 'bytes' to socket makes
sense. But, how could python
On Fri, Jul 22, 2016 at 6:52 PM, Yubin Ruan wrote:
> In my understanding, writing to a file would requires that everything be
> written byte by byte. So writing objects of type 'bytes' to socket makes
> sense. But, how could python write to file using unicode(type
Hi,
I'm migrating my code to python3 now and find it hard to deal with python's
'str' and 'bytes' type. It's kind of painful.
One thing I find really confusing is that, writing to a socket requires
argument to be of type 'bytes'(otherwi
Hello All,
I have been trying to write a test framework for a pretty simple command server
application in python. I have not been able to figure out how to test the
socket server.
I would really appreciate if you could help me out in testing this application
using unittest.
Please kindly
Matt Ruffalo writes:
> ...
> I've been using SSL for the communication between the client and server,
> ...
> I've hit an issue that I'm not sure how to work through, though. I'm
> attempting to use a SSL socket (and/or the result of its 'makefile'
On Sun, Mar 20, 2016 at 4:44 AM, Matt Ruffalo wrote:
> Hi all-
>
> I'm writing a backup client for automating the synchronization of btrfs
> snapshots between machines -- essentially piping the output of `btrfs
> send` on my laptop/desktop to `btrfs receive` on a server. I've been
> doing this man
n to
verifying the client certificates against a trusted CA, this also allows
things like selecting the backup destination based on the common name in
the client cert.
I've hit an issue that I'm not sure how to work through, though. I'm
attempting to use a SSL socket (and/or the result o
> I received this from a socket connection. This is the received data:
>
> Adding more info --> the response is a mixture of hex numbers + ascii
>
> [...]
>
> How is the best way to decode such reply from server?
>https://docs.python.org/3/library/struct.html#examples
Joaquin Alzola :
> I received this from a socket connection. This is the received data:
>
> Adding more info --> the response is a mixture of hex numbers + ascii
>
> [...]
>
> How is the best way to decode such reply from server?
https://docs.python.org/3/library/stru
On 2016.03.11 07:17, Joaquin Alzola wrote:
> HI Guys
>
> I received this from a socket connection. This is the received data:
>
> Adding more info --> the response is a mixture of hex numbers + ascii
>
> From python function --> data = s.recv(2048)
>
> b'
HI Guys
I received this from a socket connection. This is the received data:
Adding more info --> the response is a mixture of hex numbers + ascii
>From python function --> data = s.recv(2048)
b'\x01\x00\x00D\x00\x00\x01\x18\x00\x00\x00\x00p2E\xe1+\xe8xG\x00\x00\x01\x08@\x00\x00\
HI Guys
I received this from a socket connection. This is the received data:
>From python function --> data = s.recv(2048)
b'\x01\x00\x00D\x00\x00\x01\x18\x00\x00\x00\x00p2E\xe1+\xe8xG\x00\x00\x01\x08@\x00\x00\x0bmmm\x00\x00\x00\x01(@\x00\x00\x16mmm.xx.com\x00\x00\x00\x00\x01\x
On 11 February 2016 at 17:10, Ulli Horlacher
wrote:
>
> Ulli Horlacher wrote:
> As a hack, I modified the standard library module tarfile.py:
>
> root@diaspora:/usr/lib/python2.7# vv -d
> --- ./.versions/tarfile.py~1~ 2015-06-22 21:59:27.0 +0200
> +++ tarfile.py 2016-02-11 18:01:50.185
Lars Gustäbel wrote:
> On Fri, Feb 12, 2016 at 09:35:40AM +0100, Antoon Pardon wrote:
> > On 02/11/2016 06:27 PM, Lars Gustäbel wrote:
> > > What about using an iterator?
> > >
> > > def myiter(tar):
> > > for t in tar:
> > > print "extracting", t.name
> > > yield t
> > >
> > >
On Fri, Feb 12, 2016 at 09:35:40AM +0100, Antoon Pardon wrote:
> On 02/11/2016 06:27 PM, Lars Gustäbel wrote:
> > What about using an iterator?
> >
> > def myiter(tar):
> > for t in tar:
> > print "extracting", t.name
> > yield t
> >
> > sfo = sock.makefile('r')
> > taro = tarfi
On 02/11/2016 06:27 PM, Lars Gustäbel wrote:
> On Thu, Feb 11, 2016 at 04:41:43PM +, Ulli Horlacher wrote:
>> sfo = sock.makefile('r')
>> taro = tarfile.open(fileobj=sfo,mode='r|')
>> taro.extractall(path=edir)
> What about using an iterator?
>
> def myiter(tar):
> for t in tar:
>
On Thu, Feb 11, 2016, at 11:41, Ulli Horlacher wrote:
> When I use:
>
> for member in taro.getmembers():
> print('extracting "%s"' % member.name)
> taro.extract(member)
>
> I get the error:
>
> File "/usr/lib/python2.7/tarfile.py", line 556, in seek
> raise StreamError("seeki
On Thu, Feb 11, 2016 at 04:41:43PM +, Ulli Horlacher wrote:
> sfo = sock.makefile('r')
> taro = tarfile.open(fileobj=sfo,mode='r|')
> taro.extractall(path=edir)
What about using an iterator?
def myiter(tar):
for t in tar:
print "extracting", t.name
yield t
sfo = soc
Ulli Horlacher wrote:
> Ulli Horlacher wrote:
>
>> With
>>
>> taro = tarfile.open(fileobj=sock.makefile('w',kB64),mode='w|')
>>
>> I get no more error.
>
> Of course, this is the writing client.
>
> Now I have a small problem with the reading client.
>
> This code works so far:
>
> sfo
Ulli Horlacher wrote:
> This code works so far:
>
> sfo = sock.makefile('r')
> taro = tarfile.open(fileobj=sfo,mode='r|')
> taro.extractall(path=edir)
>
> But it does not writes anything to the terminal to inform the user.
>
> When I use:
>
> for member in taro.getmembers():
>
On 2016-02-11 16:41, Ulli Horlacher wrote:
Ulli Horlacher wrote:
With
taro = tarfile.open(fileobj=sock.makefile('w',kB64),mode='w|')
I get no more error.
Of course, this is the writing client.
Now I have a small problem with the reading client.
This code works so far:
sfo = sock.ma
Ulli Horlacher wrote:
> With
>
> taro = tarfile.open(fileobj=sock.makefile('w',kB64),mode='w|')
>
> I get no more error.
Of course, this is the writing client.
Now I have a small problem with the reading client.
This code works so far:
sfo = sock.makefile('r')
taro = tarfile.open(fil
Chris Angelico wrote:
> Sounds like tarfile needs a seekable file. How big is this file you're
> reading?
No limits. It can be many TBs...
The use case is:
http://fex.rus.uni-stuttgart.de:8080/
--
Ullrich Horlacher Server und Virtualisierung
Rechenzentrum IZUS/TIK E-Mai
Ulli Horlacher wrote:
> I have:
>
> sock = socket.create_connection((server,port))
> bs = kB64
> taro = tarfile.open(fileobj=sock.makefile('w',kB64),mode='w')
>
>
>
> Traceback (most recent call last):
> (...)
> File "./fexit.py", line 1838, in sex_send
> taro = tarf
On Thu, Feb 11, 2016 at 11:53 PM, Ulli Horlacher
wrote:
> I have:
>
> sock = socket.create_connection((server,port))
> bs = kB64
> taro = tarfile.open(fileobj=sock.makefile('w',kB64),mode='w')
>
>
>
> Traceback (most recent call last):
> (...)
> File "./fexit.py", line 1838, in sex_send
On 2016-02-11 12:53, Ulli Horlacher wrote:
Antoon Pardon wrote:
> (How) can I read a tar file from a (tcp) socket?
> I do not have a pathname but a socket object from socket.create_connection
# First you construct a file object with makefile.
fo = socket.makefile()
# Then you u
Antoon Pardon wrote:
> > (How) can I read a tar file from a (tcp) socket?
> > I do not have a pathname but a socket object from socket.create_connection
>
> # First you construct a file object with makefile.
>
> fo = socket.makefile()
>
> # Then you use the file
On 02/11/2016 09:31 AM, Ulli Horlacher wrote:
> https://docs.python.org/2/library/tarfile.html says:
>
> tarfile.open(name=None, mode='r', fileobj=None, bufsize=10240, **kwargs)
>
> Return a TarFile object for the pathname name.
>
>
> (How) can I read a ta
Have you tried socket.makefile() method?
--
https://mail.python.org/mailman/listinfo/python-list
https://docs.python.org/2/library/tarfile.html says:
tarfile.open(name=None, mode='r', fileobj=None, bufsize=10240, **kwargs)
Return a TarFile object for the pathname name.
(How) can I read a tar file from a (tcp) socket?
I do not have a pathname but a socket o
Hi,
I am trying to write UNIX socket client which sends 1 cmd
and saves the received data to a file.
Based on what I found on documentation I came up with::
import asyncio
class UnixProtocol(asyncio.Protocol):
def __init__(self, loop):
self.cmd = 'show stat\n'
self.l
On 28Oct2015 10:41, Robin Becker wrote:
binding to the local IP seems to be a windows only thing.
No, it is a pretty standard BSD socket layer thing. (Windows got its original
TCP stack from there too). I just tested a Linux RHEL6 host binding to a
specific address just now using telnet
..
binding to the local IP seems to be a windows only thing.
No, it is a pretty standard BSD socket layer thing. (Windows got its original
TCP stack from there too). I just tested a Linux RHEL6 host binding to a
specific address just now using telnet:
/usr/bin/telnet -b x.x.x.193
/questions/335607/how-do-i-make-an-outgoing-socket-to-a-specific-network-interface
http://stackoverflow.com/questions/8437726/can-python-select-what-network-adapter-when-opening-a-socket
binding to the local IP seems to be a windows only thing.
No, it is a pretty standard BSD socket layer thing. (W
correct IP address should
normally be sufficient. The system you're talking to won't know anything about
the device, only the address. Try skipping the device binding step.
According to the stackoverflow articles here
http://stackoverflow.com/questions/335607/how-do-i-make-an-outgoing-s
On 26Oct2015 12:33, Robin Becker wrote:
.
device? --
Robin Becker
Using eth0:0 is normally a method to setup eth0 to respond to a 2nd
IPV4/IPV6 address. Have you done the ifconfig steps to enable that? If
its been done, you will see it's 2nd address in an ifconfig query. Man
pa
ginal email; when I try to execute the
commands to bind to that device I get an error eg
# ~rptlab/tmp/proxy/bin/python
Python 2.7.5 (default, Aug 20 2013, 15:27:38)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more inform
proxy and hacked the connection code so it looked
> like this
>
>
> proxy.py
> ....
>
> > from socket import socket, SOL_SOCKET
> > ...
> > import os
> > BIND_ADDRESS = os.environ.get('PYMIPROXY_BIND_ADDRESS',None)
> > BIND_DEVICE = os.env
from socket import socket, SOL_SOCKET
...
import os
BIND_ADDRESS = os.environ.get('PYMIPROXY_BIND_ADDRESS',None)
BIND_DEVICE = os.environ.get('PYMIPROXY_BIND_DEVICE',None)
.
# Connect to destination
sock = self._proxy_sock = socket()
sock.
Random832 wrote:
Isn't this technically the same problem as pressing ctrl-d at a terminal
- it's not _really_ the end of the input (you can continue reading
after), but it sends the program something it will interpret as such?
Yes. There's no concept of "closing the connection" with UDP,
becau
On Tue, Sep 22, 2015, at 15:45, James Harris wrote:
> "Dennis Lee Bieber" wrote in message
> news:mailman.12.1442794762.28679.python-l...@python.org...
> > On Sun, 20 Sep 2015 23:36:30 +0100, "James Harris"
> > declaimed the following:
> >>Receiving no bytes is taken as indicating the end of the
"Marko Rauhamaa" wrote in message
news:8737y6cgp6@elektro.pacujo.net...
"James Harris" :
I agree with what you say. A zero-length UDP datagram should be
possible and not indicate end of input but is that guaranteed and
portable?
The zero-length payload size shouldn't be an issue, but UDP
"James Harris" :
> I agree with what you say. A zero-length UDP datagram should be
> possible and not indicate end of input but is that guaranteed and
> portable?
The zero-length payload size shouldn't be an issue, but UDP doesn't make
any guarantees about delivering the message. Your UDP applica
of what was documented,
of course.
I agree with what you say. A zero-length UDP datagram should be possible
and not indicate end of input but is that guaranteed and portable?
(Rhetorical.) It seems not. Even the Linux man page for recv says: "If
no messages are available at the s
f a big message is
sent successfully.)
Looking in the wrong documentation
You probably should be looking at the UDP RFC. Or maybe just
http://www.diffen.com/difference/TCP_vs_UDP
"""
Packets are sent individually and are checked for integrity only if
they
arrive. Packets have definit
>>> encoding.
>>>
>>> Not sure what you mean there. Unless you can absolutely guarantee that
>>> you didn't read too much, or can absolutely guarantee that your
>>> buffering function will be the ONLY way anything reads from the
>>> socket,
On Mon, 2015-09-21, Cameron Simpson wrote:
> On 21Sep2015 10:34, Chris Angelico wrote:
>>If you're going to add sequencing and acknowledgements to UDP,
>>wouldn't it be easier to use TCP and simply prefix every message with
>>a two-byte length?
>
> Frankly, often yes. That's what I do. (different
can read a full buffer even if you have a variable-length length
encoding.
Not sure what you mean there. Unless you can absolutely guarantee that
you didn't read too much, or can absolutely guarantee that your
buffering function will be the ONLY way anything reads from the
socket, buffering is a
available? Or does the implementation have to look into sys.platform?
>>> import socket
>>> 'TCP_CORK' in dir(socket)
True
On which platform was this done?
Python3 on Fedora 21.
Python2 on RHEL4.
Sorry, don't have non-Linux machines to try.
How to auto
_vs_UDP
>
> """
> Packets are sent individually and are checked for integrity only if they
> arrive. Packets have definite boundaries which are honored upon receipt,
> meaning a read operation at the receiver socket will yield an entire
> message as it was originally sen
there. Unless you can absolutely guarantee that
>> you didn't read too much, or can absolutely guarantee that your
>> buffering function will be the ONLY way anything reads from the
>> socket, buffering is a problem.
>
> Only one reader can read a socket safely at any give
Chris Angelico :
> On Mon, Sep 21, 2015 at 6:38 PM, Marko Rauhamaa wrote:
>> Only one reader can read a socket safely at any given time so mutual
>> exclusion is needed.
>>
>> If you read "too much," the excess can be put in the application's read
&
vailable are both option constants also not
>>> available? Or does the implementation have to look into sys.platform?
>>
>>>>> import socket
>>>>> 'TCP_CORK' in dir(socket)
>>True
>
> On which platform was this done?
Pyt
Marko Rauhamaa :
> Chris Angelico :
>
>> On Mon, Sep 21, 2015 at 6:38 PM, Marko Rauhamaa wrote:
>>> Only one reader can read a socket safely at any given time so mutual
>>> exclusion is needed.
>>>
>>> If you read "too much," the excess c
1 - 100 of 1520 matches
Mail list logo