[Pythonmac-SIG] Error 45 with Paos and setsockopt

Stefan Witzgall stefan.witzgall@online.de
Sun, 9 Sep 2001 11:31:19 +0200


Dear PythonMac-list,

I tried the database server Paos found on www.sourceforge.net and run into
a problem.

The interpreter and the IDE give me an error 45 when running the Server.py
script:

------------------------------Traceback window-------------------------
error: (45, 'Operation not supported on socket')
Traceback (innermost last):
--------------------------------------------------
File "Server.py", line 50, in ?
      s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
--------------------------------------------------
------------------------------Traceback window-------------------------

Could you please give me any advise to fix the problem or is anyone using
Paos here on the list?

I found Paos  when I searched for an database for/with/in Python. At least
I can run GadFly, a SQL- database with MacPython. With MetaKit I did run
into the problem that the .slb file is too old for MacPython 2.1.1 and too
new for 1.5.2c1. Perhaps you have any thoughts about that too.

Thank You for reading this and any help or hint.

Stefan


##############################################################################
Here are the first few lines of Server.py, changed by me as you can see to
run on my Macintosh:

#
# Copyright 1995 Carlos Maltzahn
[copyright]
#
# Author:
# 	Carlos Maltzahn
# 	Dept. of Computer Science
# 	Campus Box 430
# 	Univ. of Colorado, Boulder
# 	Boulder, CO 80309
#
# 	carlosm@cs.colorado.edu
#

import sys
import socket
import select
import pickle
import string
from types import *
import traceback
import Store
import Utilities

"""
stef commented these lines to test on a Macintosh:
if len(sys.argv) not in [2,3]:
  print 'Usage: python Server.py <port> [<database file name>]'
  sys.exit(1)
"""
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
"""
stef commented this line:
s.bind('',string.atoi(sys.argv[1]))
and made this:
"""
portnumber = 10050 # arbitrary chosen portnumber
s.bind('',portnumber)

s.listen(5)

conn_table = {} # conn -> client
client_table = {} # client -> conn
conn_list = [s]

print 'Server: ready and listening'

while 1:
  (ready_list, x, y) = select.select(conn_list, [], [])
  for ready_conn in ready_list:
    if ready_conn is s:
      (conn, address) = s.accept()
[the rest of Server.py]

<Stefan.Witzgall@online.de>