Click here to Skip to main content
15,887,596 members
Home / Discussions / C#
   

C#

 
GeneralRe: c# Pin
#realJSOP2-Jul-18 8:30
mve#realJSOP2-Jul-18 8:30 
GeneralRe: c# Pin
Richard Deeming2-Jul-18 8:33
mveRichard Deeming2-Jul-18 8:33 
Question{ get; set; } Pin
Xarzu29-Jun-18 9:17
Xarzu29-Jun-18 9:17 
AnswerRe: { get; set; } Pin
harold aptroot29-Jun-18 9:37
harold aptroot29-Jun-18 9:37 
Answerc# Pin
Member 1389187629-Jun-18 6:28
Member 1389187629-Jun-18 6:28 
GeneralRe: c# Pin
Nathan Minier29-Jun-18 6:49
professionalNathan Minier29-Jun-18 6:49 
GeneralRe: c# Pin
OriginalGriff29-Jun-18 8:01
mveOriginalGriff29-Jun-18 8:01 
Questionc# threading. timers Pin
Member 1284917529-Jun-18 0:51
Member 1284917529-Jun-18 0:51 
I am using custom client connection for 10 tcp clients.

bool _flagScanner1Connect = true;
private xyzTranmissionProtocol xyz1TranmissionProtocol = null;
private static readonly object LockWhileConnectingForScanner1 = new object();
internal ICustomClient Scanner1Conn;
System.Threading.Timer _tmrCheck1ClientConn;
public void Start1ScannerConn() { try { _tmrCheck1ClientConn = new System.Threading.Timer(Check1ScannerConn, null, TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(5));
}
catch (Exception )
{

}
}
private void Check1ScannerConn(object state)
{ if (!_flagScanner1Connect) return;
lock (LockWhileConnectingForScanner1) {
if (Scanner1Conn == null || Scanner1Conn.CommunicationState == ClientCommunicationStates.Disconnected) {
try { _tmrCheck1ClientConn.Change(Timeout.Infinite, Timeout.Infinite);
Scanner1Conn = CustomClientFactory.CreateClient(new CustomClientTcpEndPoint(“Scanner IpAdress”, “Scanner Port Number”));
Scanner1Conn.Connected += Scanner1Conn_Connected; ;
Scanner1Conn.Disconnected += Scanner1Conn_Disconnected;
Scanner1Conn.MessageReceived += Scanner1Conn_MessageReceived;
xyz1TranmissionProtocol = new xyzTranmissionProtocol();
Scanner1Conn.TransmissionProtocol = xyz1TranmissionProtocol;
Scanner1Conn.Connect();
//SEND A PING MESSAGE
_tmrCheck1ClientConn.Change(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(5));



}
catch (Exception )
{
if (_flagScanner1Connect)



try
{
Scanner1Conn?.Disconnect();
}
catch { }
try
{
Scanner1Conn?.Dispose();
}
catch { }
try
{
Scanner1Conn = null;
}
catch { }
}
finally
{
_tmrCheckClientConn.Change(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(5));
}
}
}
}

I have written 10 different functions for 10 bar code scanners. above code is for 1 scanner. if i use 3 scanners or less than 3 my application will work. but if i use more than 3 scanners then message received events will not work And the application will become very slow. can anyone help me out to solve this issue.
AnswerRe: c# threading. timers Pin
Richard Andrew x6430-Jun-18 3:20
professionalRichard Andrew x6430-Jun-18 3:20 
QuestionHow do i allow user to reorder the rows in a form gridview in c# Pin
Dipk1129-Jun-18 0:24
Dipk1129-Jun-18 0:24 
AnswerRe: How do i allow user to reorder the rows in a form gridview in c# Pin
OriginalGriff29-Jun-18 0:49
mveOriginalGriff29-Jun-18 0:49 
GeneralRe: How do i allow user to reorder the rows in a form gridview in c# Pin
Dipk1129-Jun-18 0:52
Dipk1129-Jun-18 0:52 
QuestionMessage Removed Pin
28-Jun-18 9:32
Xarzu28-Jun-18 9:32 
AnswerMessage Removed Pin
1-Jul-18 15:55
professionalBillWoodruff1-Jul-18 15:55 
QuestionHow to check the activeness of any layer/component in any WPF/windows application using C# Pin
AnubhavSinghChauhan27-Jun-18 23:37
AnubhavSinghChauhan27-Jun-18 23:37 
AnswerRe: How to check the activeness of any layer/component in any WPF/windows application using C# Pin
Eddy Vluggen28-Jun-18 1:14
professionalEddy Vluggen28-Jun-18 1:14 
QuestionIs it a good practice to create models with Interfaces and not having a concrete implementation of the same. Pin
Member 1379256827-Jun-18 19:51
Member 1379256827-Jun-18 19:51 
AnswerRe: Is it a good practice to create models with Interfaces and not having a concrete implementation of the same. Pin
Pete O'Hanlon27-Jun-18 22:48
mvePete O'Hanlon27-Jun-18 22:48 
GeneralRe: Is it a good practice to create models with Interfaces and not having a concrete implementation of the same. Pin
Member 1379256827-Jun-18 22:54
Member 1379256827-Jun-18 22:54 
GeneralRe: Is it a good practice to create models with Interfaces and not having a concrete implementation of the same. Pin
Pete O'Hanlon28-Jun-18 1:45
mvePete O'Hanlon28-Jun-18 1:45 
QuestionComparing Hashed Passwords - Part 2 Pin
Kevin Marois24-Jun-18 19:02
professionalKevin Marois24-Jun-18 19:02 
AnswerRe: Comparing Hashed Passwords - Part 2 Pin
OriginalGriff24-Jun-18 19:51
mveOriginalGriff24-Jun-18 19:51 
GeneralRe: Comparing Hashed Passwords - Part 2 Pin
#realJSOP27-Jun-18 1:25
mve#realJSOP27-Jun-18 1:25 
GeneralRe: Comparing Hashed Passwords - Part 2 Pin
OriginalGriff27-Jun-18 1:30
mveOriginalGriff27-Jun-18 1:30 
GeneralRe: Comparing Hashed Passwords - Part 2 Pin
Richard Deeming27-Jun-18 1:30
mveRichard Deeming27-Jun-18 1:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.