code: public void connect(IConnection conn) {
          if (conn instanceof RTMPConnection) {
              if (!isConnected()) {
                  source = conn;
                  SharedObjectMessage msg = new SharedObjectMessage(name, 0, isPersistent());
                  msg.addEvent(new SharedObjectEvent(Type.SERVER_CONNECT, null, null));
                  Channel c = ((RTMPConnection) conn).getChannel(3);
                  c.write(msg);
              } else {
                  throw new UnsupportedOperationException("Already connected");
              }
          } else {
              throw new UnsupportedOperationException("Only RTMP connections are supported");
          }
      }
docs: Connect the shared object using the passed connection.
  
  @param conn
  Attach SO to given connection