Click here to Skip to main content
15,920,217 members
Home / Discussions / C#
   

C#

 
AnswerRe: Hide web service details? Pin
Ferry Mulyono6-Apr-06 15:13
Ferry Mulyono6-Apr-06 15:13 
GeneralRe: Hide web service details? Pin
Mark Tutt6-Apr-06 15:41
Mark Tutt6-Apr-06 15:41 
GeneralRe: Hide web service details? Pin
Ferry Mulyono6-Apr-06 16:01
Ferry Mulyono6-Apr-06 16:01 
GeneralRe: Hide web service details? Pin
Mark Tutt6-Apr-06 16:35
Mark Tutt6-Apr-06 16:35 
QuestionPass SerialPort variable to another class. Pin
shultas6-Apr-06 12:03
shultas6-Apr-06 12:03 
AnswerRe: Pass SerialPort variable to another class. Pin
Judah Gabriel Himango6-Apr-06 12:32
sponsorJudah Gabriel Himango6-Apr-06 12:32 
AnswerRe: Pass SerialPort variable to another class. Pin
Stefan Troschuetz6-Apr-06 12:35
Stefan Troschuetz6-Apr-06 12:35 
GeneralRe: Pass SerialPort variable to another class. Pin
shultas6-Apr-06 12:49
shultas6-Apr-06 12:49 
Thanks for the quick reply, I appreciate it.

Yes, the multiple _sp.Write()'s work just fine. The flow of the program is as such: Program Loads. Main Class creates a new thread (the thread is another class). The thread then creates an initializes a SerialPort variable, and opens the COM PORT. Next, that thread creates the Provider (TcpServiceProvider) and starts the server. (It has an AsyncCallBack that calls a method within the TCPServer class when data is received from the TCP port). After it does that stuff, I basically have a while (running) { } loop in there that just keeps it running until you press the close button. (I put code in there to write to a file while it was running, and it runs non-stop). While it is running, it is basically calling SerialPort.ReadExisting() to get what's in the buffer (if anything). It just keeps looping and checking the incoming com port buffer for text. If it sees any text, that thread calls the TCPServer class "SendString" method to send out the string. That works totally fine, when I send data into the COM port on my PC, it immediately shows up in the telnet window. When I type in the telnet window, a message box pops up saying "I received this text: " and the text, directly after the message box text it does the _sp.Write() method, but nothing ever shows up on the COM port at that point. But, if I go ahead and type some more stuff on the COM port after that, it shows up in the telnet window (so that is telling me that the COM port is being held open). The odd thing is that no errors are thrown and no exceptions or program crashes are happening and I'm totally stumped at this point.

Again, thanks for the help, it is gladly accepted Smile | :)

*** Addendum: I just loaded this up in debugger as the other poster had mentioned, and I get the following error:
A first chance exception of type 'System.NullReferenceException' occurred in TcpServerDemo.exe

So it does appear that at some point that local pointer:

_sp = sp;

is getting wiped out for some reason?
GeneralRe: Pass SerialPort variable to another class. Pin
Stefan Troschuetz6-Apr-06 22:48
Stefan Troschuetz6-Apr-06 22:48 
QuestionMaybe not an interesting question, but... Pin
Stanciu Vlad6-Apr-06 11:55
Stanciu Vlad6-Apr-06 11:55 
AnswerRe: Maybe not an interesting question, but... Pin
Judah Gabriel Himango6-Apr-06 12:24
sponsorJudah Gabriel Himango6-Apr-06 12:24 
GeneralRe: Maybe not an interesting question, but... Pin
Stanciu Vlad6-Apr-06 22:33
Stanciu Vlad6-Apr-06 22:33 
GeneralRe: Maybe not an interesting question, but... Pin
Judah Gabriel Himango7-Apr-06 4:01
sponsorJudah Gabriel Himango7-Apr-06 4:01 
AnswerRe: Maybe not an interesting question, but... Pin
Graham Nimbley6-Apr-06 15:55
Graham Nimbley6-Apr-06 15:55 
QuestionHelp me..with this message..The server viewstate cache has timed out. Pin
jorgeils6-Apr-06 11:53
jorgeils6-Apr-06 11:53 
AnswerRe: Help me..with this message..The server viewstate cache has timed out. Pin
Judah Gabriel Himango6-Apr-06 12:23
sponsorJudah Gabriel Himango6-Apr-06 12:23 
QuestionPls Help me Pin
narendrakumarp6-Apr-06 10:30
narendrakumarp6-Apr-06 10:30 
AnswerRe: Pls Help me Pin
Judah Gabriel Himango6-Apr-06 12:22
sponsorJudah Gabriel Himango6-Apr-06 12:22 
QuestionList of running applications Pin
Sergey Gorchichko6-Apr-06 9:17
Sergey Gorchichko6-Apr-06 9:17 
AnswerRe: List of running applications Pin
Judah Gabriel Himango6-Apr-06 10:02
sponsorJudah Gabriel Himango6-Apr-06 10:02 
QuestionRandom in C# Pin
alee15.10.886-Apr-06 8:21
alee15.10.886-Apr-06 8:21 
GeneralRe: Random in C# Pin
Office Lineman6-Apr-06 8:35
Office Lineman6-Apr-06 8:35 
GeneralRe: Random in C# Pin
alee15.10.886-Apr-06 8:40
alee15.10.886-Apr-06 8:40 
AnswerRe: Random in C# Pin
Office Lineman6-Apr-06 8:45
Office Lineman6-Apr-06 8:45 
GeneralRe: Random in C# Pin
alee15.10.886-Apr-06 9:11
alee15.10.886-Apr-06 9:11 

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.