![]() |
| ||
| How to send a process list over tcp connection i can get it to write one line, but then it is "forcibly stopped" probably because of the way that the client listens for a response. Send: case "procls":Listen: stm.Write(ba, 0, ba.Length); any suggestions? |
| ||
| Re: How to send a process list over tcp connection I think the forcibly stopped comes from the reader application reading one line and exiting. Can you put the read into a loop of some form? If you're going to write to the stream more than once, you should probably read more than once. You'll probably want to add detection for the stream closing to the reader after you start the loop. And the read loop should block somewhere, either for the stream to be ready or for a time period. You don't want it running in a tight loop burning cpu cycles without a purpose. |
| ||
| Re: How to send a process list over tcp connection Could you explain that a little more? Im still very new to C# and Im not sure I fully understand. |
| ||
| Re: How to send a process list over tcp connection I think Murtan is right. Why don't you take a look in to "remoting" in C#. It basically allows you to call methods running on another computer. IE you have a 'server' application running on a remote machine and you can call methods and pass values. In this case you could make a serialized process list and transmit that across the pipe which would abstract away having to deal with sockets. If you want to do sockets then please upload a sample project so we can take a look at what is causing the error. |
| ||
| Re: How to send a process list over tcp connection I warn you, the code is extremely messy, its a work in progress: Client: while (true) Server: TcpListener server = null; |
| ||
| Re: How to send a process list over tcp connection I was messing around with the code that listens for a response and made it send commands...somehow. i had to restore to a backup of my program so Im not sure whats different. I do have an idea though. What if, I requested the total number of processes from the server computer, and with that number, my program knew how many responses to listen for? |
| ||
| Re: How to send a process list over tcp connection no, I should make it listen until there is no response |
| ||
| Re: How to send a process list over tcp connection This is weird, I made a post last night and its gone. i was messing around with the tcp connection and nothing was being sent so i had to restore to a backup I made. Im thinking that their should be a way to make it so that it stays open until there is no response. |
| ||
| Re: How to send a process list over tcp connection Why do my posts disappear and then reappear? |
| ||
| Re: How to send a process list over tcp connection This sounds like a browser error to me. Maybe you closed your browser before the submit? I don't know. If a moderator deletes your post you will receive a private message in the forum stating that it has been deleted. Check your message box. |
| All times are GMT -4. The time now is 4:44 pm. |
Forum system based on vBulletin Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
©2003 - 2010 DaniWeb® LLC