Exemple #1
0
 public void Set(CloseConnectionOptions other)
 {
     if (other != null)
     {
         m_ApiVersion = P2PInterface.CloseconnectionApiLatest;
         LocalUserId  = other.LocalUserId;
         RemoteUserId = other.RemoteUserId;
         SocketId     = other.SocketId;
     }
 }
Exemple #2
0
        /// <summary>
        /// Stop accepting new connections from a specific peer and close any open connections.
        /// </summary>
        /// <param name="options">Information about who would like to close a connection, and which connection.</param>
        /// <returns>
        /// <see cref="Result" />::<see cref="Result.Success" /> - if the provided data is valid
        /// <see cref="Result" />::<see cref="Result.InvalidParameters" /> - if the provided data is invalid
        /// </returns>
        public Result CloseConnection(CloseConnectionOptions options)
        {
            System.IntPtr optionsAddress = new System.IntPtr();
            Helper.TryMarshalSet <CloseConnectionOptionsInternal, CloseConnectionOptions>(ref optionsAddress, options);

            var funcResult = EOS_P2P_CloseConnection(InnerHandle, optionsAddress);

            Helper.TryMarshalDispose(ref optionsAddress);

            return(funcResult);
        }