public OhpiMarshal GetMarshal() { OhpiMarshal m; lock ( marshals ) { if (marshals.Count > 0) { m = marshals.First.Value; marshals.RemoveFirst(); } else { m = new OhpiMarshal(); bool rc = m.Open(domain.GetRemoteHost(), domain.GetRemotePort()); if (!rc) { m = null; } } if (m != null) { m.Reset(); } } return(m); }
public OhpiMarshal GetMarshal() { OhpiMarshal m; lock ( marshals ) { if ( marshals.Count > 0 ) { m = marshals.First.Value; marshals.RemoveFirst(); } else { m = new OhpiMarshal(); bool rc = m.Open( domain.GetRemoteHost(), domain.GetRemotePort() ); if ( !rc ) { m = null; } } if ( m != null ) { m.Reset(); } } return m; }