Jython: error(92, "Socket option 'TCP_NODELAY' (level 'IPPROTO_TCP') not supported on socket

Anonymous avatarAnonymous created an issue

This error is raised when running a CherryPy test suite on Jython (r6628)

The suggested workaround of

import socket
socket.IPPROTO_TCP = 6 

Doesn't seem to make any difference for me. Maybe I'm not applying it soon enough. The next workaround however does work:

Index: cherrypy/test/helper.py
===================================================================
--- cherrypy/test/helper.py     (révision 2485)
+++ cherrypy/test/helper.py     (copie de travail)
@@ -110,6 +110,8 @@
     for testmod in moduleNames:
         cherrypy.config.reset()
         cherrypy.config.update(conf)
+        if sys.platform[:4] == 'java':
+            cherrypy.config.update({'server.nodelay': False})
         setup_client()

         if '.' in testmod:

Would that sound suitable?

Reported by lawouach

Comments (7)

  1. Anonymous

    Sorry by annoy, but what version of Jython and Java are you testing? Because here I tested with jython 2.5.0, 2.5.1 and 2.5.2rc2 and I couldn't got to work CherryPy with Jython that closes returning the same error related in this bug. My java version is 1.6.0_22-b04. I attached my complete error log.

  2. Anonymous

    Hi,

    What did you try? The test suite or just a CP application on Jython? Have you turned off server.nodelay in your config?

  3. Anonymous

    Sorry, I forgot the ticket was about test suite. I tested with the Hello World Example from CherryPy Home Page:

    import cherrypy
    
    class HelloWorld(object):
        def index(self):
            return "Hello World!"
        index.exposed = True
    
    cherrypy.quickstart(HelloWorld())
    

    but strangely, if I comment on socket.py file where the error is raised, this example worked well.

  4. Anonymous

    About config, I couldn't tested before because I wasn't familiar with the problem reported on #950. Now I tested with 'server.nodelay' and worked well.

    Thanks by attention and sorry one more time for bothering.

  5. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.