public bool TestConnection() { StoredCommands cmd = new StoredCommands(); cmd.AppendSceneCommand_ListSelectedObjects(); BinarySerializer serializer = new BinarySerializer(); cmd.Store(serializer); vectorub commandBuf = serializer.buffer(); byte[] sendBuf = commandBuf.ToArray <byte>(); int nSent = m_pSendSock.Send(sendBuf, sendBuf.Length, m_remoteIP); int nSaveTimeout = m_pReceiveSock.Client.ReceiveTimeout; m_pReceiveSock.Client.ReceiveTimeout = 200; bool bReceiveOK = true; IPEndPoint remoteIP = new IPEndPoint(IPAddress.Any, 0); try { byte[] receiveBuf = m_pReceiveSock.Receive(ref remoteIP); bReceiveOK = true; } catch (SocketException) { bReceiveOK = false; } m_pReceiveSock.Client.ReceiveTimeout = nSaveTimeout; return(bReceiveOK); }
private List <int> get_selected_objects(mm.RemoteControl rc) { StoredCommands sc = new StoredCommands(); uint key = sc.AppendSceneCommand_ListSelectedObjects(); rc.ExecuteCommands(sc); vectori v = new vectori(); bool bOK = sc.GetSceneCommandResult_ListSelectedObjects(key, v); return(v.ToList()); }
public List <int> ListSelectedObjects() { StoredCommands sc = new StoredCommands(); uint key = sc.AppendSceneCommand_ListSelectedObjects(); ExecuteCommands(sc); vectori newobjs = new vectori(); sc.GetSceneCommandResult_ListSelectedObjects(key, newobjs); return(newobjs.ToList()); }