I have finally made it work with this code:
function server (index)
modem.open(2001)
modem.open(3001)
_,_,_,port,_,signal = event.pull("modem_message")
modem.close(2001)
modem.close(3001)
gpu.set(1,10,tostring(port))
signal = serialization.unserialize(signal)
gpu.set(1,1,tostring(source).." did send: "..signal)
if signal == password then
ColorSet(1,0xFF6600)
gpu.set(1,2,"Password accepted")
modem.broadcast(port + 1,"true")
gpu.set(1,11,"Answer send")
while true do
modem.open(port+2)
_,_,_,port_1,_,signal = event.pull("modem_message")