Question: I am trying to extract the length of an integer column but I get this error as below. Can someone share their thoughts on this? Thanks.

**`Error: Argument type mismatch in function LENGTH: first argument is type int64`**

Answer: 
I might be wrong, but these two must be your major problems: 

1. `signaling_server.send(...` I am not seeing any target here, so guessing that the server just broadcasts this message to everyone. When you are sending an sdp to already established peer connection, you are bound to get the error which you are getting now. My suggesting would be to add a target id in the message, either the server can forward it to that particular peer or, server can just broadcast, but `event_handler` of the peer can check if the target id of message is same as it's own id, if not, just ignore the message.
2. `onicecandidate` event, you are broadcasting the ICE candidates to all remote peers, again this is meant for single peer, another issue might be, `addIceCandidate` on PeerConnection before setting it's local and remote description would throw error, you need to some sort of mechanism to handle this( add ICE candidates only after setting the connections descriptions).

finally a suggestion. I am guessing `peer_connection` is an Array, if you change it Object, you can remove the redundancy of `locate_peer_connection`, 

you can do something like.

```
if(peer_connection[signal.id]){
    //do something...
}else{
    peer_connection[signal.id] = new PeerConnection(...
}

```
i had the same problem when i was implementing one-to-many rtc broadcast, and what mido22 said is right. you might be sending/resetting existing established peer object with other incoming client. you have to create new RTCPeerConenction object for every new incoming client. the general work flow would be as follow.  

```
peerconnection=[];//empty array

```

then you initialize your media devices with getUserMedia
and store media stream into global variable so that it can be added when creating offer.  

once this is done you inform your singalling server with unique id   

your signalling server may then broadcast this to all clients except from which it is received. each client will then check if that unique id does exist in there peerconnection array and like mido22 said you can do this as

```
if(peerconnection[signal.id])
{
//do something with existing peerconnections
}
else
{
peerconnection[signal.id]=new RTCPeerConnection({"stun_server_address"});
//register peerconnection[signal.id].onicecandidate callback
//register peerconnection[signal.id].onaddstream callback
//createoffer
//if local stream is ready then
peerconnection[signal.id].addStream(localStream);
//and rest of the stuff go as it is  like in one-to-one call..
//setLocalDescriptor setRemoteDescriptor
}

```