Exemple #1
0
def get_transport_layer_by_name(name, local_port, remote_port, msg_handler):
    assert name == 'dummy' or name == 'ss' or name == 'gbn'
    if name == 'dummy':
        return dummy.DummyTransportLayer(local_port, remote_port, msg_handler)
    if name == 'ss':
        return ss.StopAndWait(local_port, remote_port, msg_handler)
    if name == 'gbn':
        return gbn.GoBackN(local_port, remote_port, msg_handler)
Exemple #2
0
def _get_transport_layer_by_name(role, name, local_ip, local_port, remote_ip,
                                 remote_port, msg_handler):
    assert name == 'dummy' or name == 'ss' or name == 'gbn'  # extra control
    if name == 'dummy':
        return dummy.DummyTransportLayer(role, local_ip, local_port, remote_ip,
                                         remote_port, msg_handler)
    if name == 'ss':
        return ss.StopAndWait(role, local_ip, local_port, remote_ip,
                              remote_port, msg_handler)
    if name == 'gbn':
        return gbn.GoBackN(role, local_ip, local_port, remote_ip, remote_port,
                           msg_handler)