# Path: pycsp/parallel/ossocket.py
# PLATFORM_SYSTEM = platform.system()
# STDERR_OUTPUT = False
#     def _get_interface_ip(ifname):
# def _get_ip():
# def _connect(addr, reconnect=True):
# def start_server(server_addr=('', 0)):
# def connectNOcache(addr):
# def closeNOcache(sock):
# def sendallNOcache(sock, data):
# def recvall(sock, msg_len):
#     def __init__(self):
#     def updateCache(self, addr, sock):
#     def connect(self, addr, reconnect=True):
#     def sendallNOreconnect(self, sock, data):
#     def sendall(self, sock, data):
#     def close(self, addr):
#     def forceclose(self, addr):
#     def closeall(self):
# class ConnHandler(object):


import os
import select, threading
import errno
    import multiprocessing
import pickle
                import socket
from pycsp.parallel import ossocket
from pycsp.parallel.header import *
from pycsp.parallel.exceptions import *
from pycsp.parallel.const import *
from pycsp.parallel.configuration import *
        self.channels = {}
        self.processes = {}
        self.guards = {}

        # Unknown messages, which is moved to known messages, if a channel or processes with a matching name registers.
        # TODO: This must be capped.
        self.channels_unknown = {}
        self.processes_unknown = {}

        self.cond = cond        

        host = conf.get(PYCSP_HOST)
        port = conf.get(PYCSP_PORT)
        if port == 0 and ENVVAL_PORT in os.environ:
            port = int(os.environ[ENVVAL_PORT])
        if host == '' and ENVVAL_HOST in os.environ:
            host = os.environ[ENVVAL_HOST]

        host = host.encode()

        addr = (host, port)

        self.server_socket, self.server_addr = ossocket.start_server(addr)
        self.server_addr = (self.server_addr[0].encode(), self.server_addr[1])

        self.active_socket_list = [self.server_socket]
        self.active_socket_list_add = []

        self.thread = None


# Path: pycsp/parallel/ossocket.py
# PLATFORM_SYSTEM = platform.system()
# STDERR_OUTPUT = False
#     def _get_interface_ip(ifname):
# def _get_ip():
# def _connect(addr, reconnect=True):
# def start_server(server_addr=('', 0)):
# def connectNOcache(addr):
# def closeNOcache(sock):
# def sendallNOcache(sock, data):
# def recvall(sock, msg_len):
#     def __init__(self):
#     def updateCache(self, addr, sock):
#     def connect(self, addr, reconnect=True):
#     def sendallNOreconnect(self, sock, data):
#     def sendall(self, sock, data):
#     def close(self, addr):
#     def forceclose(self, addr):
#     def closeall(self):
# class ConnHandler(object):


# Path: pycsp/parallel/dispatch.py
import os
import select, threading
import errno
    import multiprocessing
import pickle
                import socket
from pycsp.parallel import ossocket
from pycsp.parallel.header import *
from pycsp.parallel.exceptions import *
from pycsp.parallel.const import *
from pycsp.parallel.configuration import *

        self.channels = {}
        self.processes = {}
        self.guards = {}

        # Unknown messages, which is moved to known messages, if a channel or processes with a matching name registers.
        # TODO: This must be capped.
        self.channels_unknown = {}
        self.processes_unknown = {}

        self.cond = cond        

        host = conf.get(PYCSP_HOST)
        port = conf.get(PYCSP_PORT)
        if port == 0 and ENVVAL_PORT in os.environ:
            port = int(os.environ[ENVVAL_PORT])
        if host == '' and ENVVAL_HOST in os.environ:
            host = os.environ[ENVVAL_HOST]

        host = host.encode()

        addr = (host, port)

        self.server_socket, self.server_addr = ossocket.start_server(addr)
        self.server_addr = (self.server_addr[0].encode(), self.server_addr[1])

        self.active_socket_list = [self.server_socket]
        self.active_socket_list_add = []

        self.thread = None


        self.handler = ossocket.ConnHandler()