Re: Checking refusal of a network connection

2019-06-03 Thread Markus Elfring
> How would this conversion take place? Localhost is 127.0.0.1. > Localhost6 is ::1. They are different My configuration file “/etc/hosts” provides the following information as usual. “… ::1 localhost ipv6-localhost ipv6-loopback …” > and you cannot route between the two. I got

Re: Checking support for network connections from Python client to IPv6 server

2019-06-02 Thread Markus Elfring
>> How would like to explain the error message “socket.gaierror: [Errno -9] >> Address family for hostname not supported” on my Linux test system then? > > Can you supply a tiny standalone piece of code demonstrating this error > please? The following script part would be relevant. … def

Re: Checking support for network connections from Python client to IPv6 server

2019-06-02 Thread Markus Elfring
>> How would like to explain the error message “socket.gaierror: [Errno -9] >> Address family for hostname not supported” on my Linux test system then? > > Can you supply a tiny standalone piece of code demonstrating this error > please? The following script part would be relevant. … def

Re: Checking support for network connections from Python client to IPv6 server

2019-06-01 Thread Markus Elfring
> "Handled transparently" means that an ipv6 server can handle connections > from ipv4 clients without doing anything special. It is nice if this conversion is working. > They just appear to come from a specific IPv6 address range. I got expected connections by my small script

Re: Checking refusal of a network connection

2019-06-01 Thread Markus Elfring
> It looks like the service isn't listening at the time the so.connect is > called. * I get an other impression from the programs “/usr/bin/netstat” and “/usr/bin/ss”. * The data transmission seems to work also for my small script “socket-send_test_data1.tcl” (even when the identification

Re: Checking refusal of a network connection

2019-06-01 Thread Markus Elfring
> Which specific information in that man page contradicts what I wrote? We can agree that the mentioned IP addresses are distinct. But the corresponding functionality should be equivalent. > If you think of > > | IPv4 connections can be handled with the v6 API by using the > | v4-mapped-on-v6

Re: Checking refusal of a network connection

2019-06-01 Thread Markus Elfring
>> I would expect that the IPv4 address from such a connection attempt >> would be automatically converted to a IPv6 loopback address. > > You haven't said which OS you are using, but as far as I know this > expectation will be frustrated at least on Linux: There ::1 and > 127.0.0.1 are distinct

Re: Checking refusal of a network connection

2019-06-01 Thread Markus Elfring
>> connect(3, {sa_family=AF_INET, sin_port=htons(37351), >> sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused) > > Without seeing the code, I'd be suspicious of that difference. I would expect that the IPv4 address from such a connection attempt would be

Re: Checking refusal of a network connection

2019-06-01 Thread Markus Elfring
> Also, it can be very useful to strace the client process, eg: Do you find the following background information more helpful for the desired clarification of unexpected software behaviour? elfring@Sonne:~/Projekte/Python> LANG=C strace -e trace=network /usr/bin/python3 socket-send_json_data.py

Re: Checking refusal of a network connection

2019-05-31 Thread Markus Elfring
> Well, providing minimal code samples that produce the problem would be > a start. I prefer an other approach to clarify relevant software configuration differences. > Otherwise we are just guessing... I can offer other data before. > Maybe you have a firewall problem. I hope

Checking refusal of a network connection

2019-05-31 Thread Markus Elfring
Hello, I can start a service as desired. elfring@Sonne:~/Projekte/Bau/C++/test-statistic-server1/local> ./test-statistic-server2 & /usr/bin/ss -t -l -p -H|grep test [1] 8961 waiting for connections server_id: localhost server_port: 35529 LISTEN 0 123 [::1]:35529

Re: Checking network input processing by Python for a multi-threaded server

2019-05-24 Thread Markus Elfring
> The file name for the client script is passed by a parameter to a command > which is repeated by this server in a loop. > It is evaluated then how often a known record set count was sent. In which time ranges would you expect the receiving of the complete JSON data which were sent by the child

Re: Checking network input processing by Python for a multi-threaded server

2019-05-19 Thread Markus Elfring
>> I get an other impression from the statements “self._threads.append(t)” >> (process_request) >> and “thread.join()” (server_close). > > Okay -- v3.7 has added more logic that didn't exist in the v3.5 code > I was examining... (block_on_close is new). Thanks for such a version

Re: Checking network input processing by Python for a multi-threaded server

2019-05-19 Thread Markus Elfring
> socketserver threading model is that the main server loops waiting for > connection requests, when it receives a request it creates a handler thread, This data processing style can be generally fine as long as you would like to work without a thread (or process) pool. > and then it completely

Re: Checking network input processing by Python for a multi-threaded server

2019-05-14 Thread Markus Elfring
> Nowadays, I develop typically web applications. > There, something similar to "CORBA" is used: WSDL described > "web services". Typically, they use the web infrastructure > and its protocols ("http", "https") for communication. The popularity varies for these programming interfaces over time.

Re: Checking network input processing by Python for a multi-threaded server

2019-05-14 Thread Markus Elfring
> Nowadays, I develop typically web applications. > There, something similar to "CORBA" is used: WSDL described > "web services". Typically, they use the web infrastructure > and its protocols ("http", "https") for communication. The popularity varies for these programming interfaces over time.

Re: Checking network input processing by Python for a multi-threaded server

2019-05-13 Thread Markus Elfring
> And in addition, you can derive your own class from `socketserver` > and override methods to provide whatever additional functionality > you think is necessary. Such a programming possibility remains generally. I am curious if the software development attention can be adjusted also in this

Re: Checking network input processing by Python for a multi-threaded server

2019-05-04 Thread Markus Elfring
>>> Server.shutdown() sets a flag that tells the main server to /stop >>> accepting new requests/. >> >> Can it be that this method should perform a bit more resource management >> (according to the selected configuration like “socketserver.ThreadingMixIn”)? >> > There isn't much more it

Re: Checking network input processing by Python for a multi-threaded server

2019-05-04 Thread Markus Elfring
> If you have a multi-threaded application and you want to be on > the "safe side", you always use your own locks. I suggest to reconsider your software expectations around the word “always”. There are more software design options available. > Python uses locks to protect its own data

Re: Checking network input processing by Python for a multi-threaded server

2019-05-04 Thread Markus Elfring
> Server.shutdown() sets a flag that tells the main server to /stop > accepting new requests/. Can it be that this method should perform a bit more resource management (according to the selected configuration like “socketserver.ThreadingMixIn”)? > So far as I can tell, for a

Re: Checking network input processing by Python for a multi-threaded server

2019-05-03 Thread Markus Elfring
> I suggested UDP as a TEST, not for the end use... I can understand such a suggestion. Can it distract from other software surprises? > If UDP gives you the results you expect, it most likely means there is a > problem There is a questionable software behaviour still waiting for a

Re: Checking network input processing by Python for a multi-threaded server

2019-05-03 Thread Markus Elfring
> In any multi-threaded application, you must be carefull when > accessing (and especially modifying) shared (e.g. "global") objects. > In general, you will need locks to synchronize the access. I agree to this general view. > Appending to a list (and some other elementary operations > on

Re: Checking network input processing by Python for a multi-threaded server

2019-05-02 Thread Markus Elfring
>> An instance for the class “threaded_TCP_server” and a call of >> “subprocess.run(…)”. >> > And how many connections does the subprocess make? A new TCP connection is performed with the information from the passed parameters for each call of the function “sendall”. The test command will

Re: Checking network input processing by Python for a multi-threaded server

2019-05-02 Thread Markus Elfring
>> May I expect that data were completely received from clients and accordingly >> processed by the request handler in the started threads after >> the statement “server.shutdown()” was sucessfully executed? > > Python delegates those low level services to the underlaying > network library, which

Re: Dynamic selection for network service ports?

2019-05-01 Thread Markus Elfring
> For the truly lazy, we have hash links. Thanks for your reminder. > https://docs.python.org/3/library/socketserver.html#socketserver.BaseServer.allow_reuse_address The relationship of this class attribute with the identifier (or option) “SO_REUSEADDR” might become easier to find. The use of

Re: Dynamic selection for network service ports?

2019-05-01 Thread Markus Elfring
> https://docs.python.org/3.4/library/socketserver.html > about the middle of the page... It seems that you would like to refer to an other document. https://docs.python.org/3/library/socket.html#socket-example Under which circumstances will the execution of the method “socket.setsockopt”

Re: Checking network input processing by Python for a multi-threaded server

2019-05-01 Thread Markus Elfring
> Why not provide them so that anyone trying to analyze what you are > seeing can try them for themselves. I assume that an other information system can be more appropriate for file distribution than this mailing list. > Starting a full process takes time This is usual. - Such an

Re: Checking network input processing by Python for a multi-threaded server

2019-05-01 Thread Markus Elfring
> https://docs.python.org/3/library/socketserver.html#asynchronous-mixins I have constructed a pair of small scripts for another test. A command (which refers to the second Python script) is executed 100 times by “subprocess.run()” with parameters so that the child process can send six test

Re: Checking network input processing by Python for a multi-threaded server

2019-05-01 Thread Markus Elfring
> https://docs.python.org/3/library/socketserver.html#asynchronous-mixins An example is provided also in this software documentation. May I expect that data were completely received from clients and accordingly processed by the request handler in the started threads after the statement

Re: Dynamic selection for network service ports?

2019-05-01 Thread Markus Elfring
> If your server listens on a random port how does the client know > which port to connect to? I am fiddling also with the data processing variant that such connection properties are passed as parameters for a command which is executed as a child process so that desired data can be sent back to

Re: Dynamic selection for network service ports?

2019-05-01 Thread Markus Elfring
> You'll get anything in the ephemeral ports range. From which documentation source did you get this information for the handling of a zero as an useful setting? > But the other cause is that you recently shut the server down, > and the port is still in the TIME_WAIT state. Does this technical

Re: Dynamic selection for network service ports?

2019-04-30 Thread Markus Elfring
> In Python, there's a certain amount of support. You can attempt to > bind to a port, and if you fail, try the next one in a sequence. * The zero seems to be also an usable parameter here. Is the system configuration documentation unclear about the applied value range for the port

Re: Dynamic selection for network service ports?

2019-04-30 Thread Markus Elfring
> * Which challenges from inter-process communication should be taken better > into > account for the involved programming interfaces (because of > multi-threading)? I would like to clarify another recurring challenge with network configuration. A port number should be selected somehow for

Re: Checking network input processing by Python for a multi-threaded server

2019-04-30 Thread Markus Elfring
> Does this mean that the second number in a listing like the above > should be approximatively equal? The expectation (or hope) was that an identical number of record sets would be available for each loop iteration in such a data processing approach by the server. But the reality is different

Re: Checking support for efficient appending to mapped data

2019-04-30 Thread Markus Elfring
> The file name for the client script is passed by a parameter to a command > which is repeated by this server in a loop. Additional explanations can be helpful for the shown software situation. > It is evaluated then how often a known record set count was sent. It was actually determined for

Checking network input processing by Python for a multi-threaded server

2019-04-29 Thread Markus Elfring
Hello, I constructed another multi-threaded TCP server for my needs (based on the available software documentation). https://docs.python.org/3/library/socketserver.html#asynchronous-mixins I constructed also a corresponding script which should send nine record sets (which get extracted from a

[issue35671] reserved identifier violation

2019-01-07 Thread Markus Elfring
Markus Elfring added the comment: * How do you think about to reduce the tampering with the reserved name space in mentioned source code (and also in related components)? * Would you like to avoid that this software depends on undefined behaviour

[issue35671] reserved identifier violation

2019-01-06 Thread Markus Elfring
New submission from Markus Elfring : I would like to point out that identifiers like “__DYNAMIC_ANNOTATIONS_H__” and “_Py_memory_order” do not fit to the expected naming convention of the C++ language standard. https://www.securecoding.cert.org/confluence/display/cplusplus/DCL51-CPP.+Do

[issue22956] Improved support for prepared SQL statements

2015-01-03 Thread Markus Elfring
Markus Elfring added the comment: Are you really against benefits from reusing of existing application programming interfaces for the explicit preparation and compilation of SQL statements? It seems that other software contributors like Marc-Andre Lemburg and Tony Locke show more

[issue22956] Improved support for prepared SQL statements

2014-11-27 Thread Markus Elfring
New submission from Markus Elfring: An interface for parameterised SQL statements (working with placeholders) is provided by the execute() method from the Cursor class at the moment. https://docs.python.org/3/library/sqlite3.html#sqlite3.Cursor.execute I assume that the SQL Statement Object

[issue22957] Multi-index Containers Library

2014-11-27 Thread Markus Elfring
New submission from Markus Elfring: I find a data structure like it is provided by the Boost Multi-index Containers Library interesting for efficient data processing. http://www.boost.org/doc/libs/1_57_0/libs/multi_index/doc/index.html How are the chances to integrate a class library

[issue22956] Improved support for prepared SQL statements

2014-11-27 Thread Markus Elfring
Changes by Markus Elfring elfr...@users.sourceforge.net: -- type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22956