473,386 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

DataReceived type event for tcpclient network stream?

I have a service and a client forms app - I want to be able to have the
service send data back to the client app intermittently, and I've
established a connection between the two using tcpclient.
What I can't see is any sort of event I can use that will be triggered when
data is received at the client. Is there such a thing?
Or should I create a separate "listening" thread that polls the connection
for data and then triggers whatever I need to happen? Or is there a better
way?

Thanks!

Feb 17 '08 #1
2 5022
On 17 Feb, 12:27, "JamesB" <jam...@somewhere.com.net.com.netwrote:
I have a service and a client forms app - I want to be able to have the
service send data back to the client app intermittently, and I've
established a connection between the two using tcpclient.
What I can't see is any sort of event I can use that will be triggered when
data is received at the client. Is there such a thing?
Or should I create a separate "listening" thread that polls the connection
for data and then triggers whatever I need to happen? Or is there a better
way?

Thanks!
Hah, using network, tcpip... hahaha... that wont work... neither I
will google have that ansver, nor usse msdn, just give up... pick up a
RS-232 manual, or maybe a disc, mailing in that between tha PC:s.

No, there is lots of examples how you should do it, it depends on what
you are going to do in the future that holds me back. a point to point
is good for a while, then it gets into a hub-and-spoke and after a
while you are looking for a ESB solution and integrating that to an
already established SOA architecture migrating from UDDI to whatever..
no I wont go there...

Stay away from tcpip.. networks... evil, EVIL I say... ;)
Feb 17 '08 #2
JamesB wrote:
I have a service and a client forms app - I want to be able to have
the service send data back to the client app intermittently, and I've
established a connection between the two using tcpclient.
So you presumably have a Listener in the service, waiting for a call from the
client...
What I can't see is any sort of event I can use that will be
triggered when data is received at the client. Is there such a thing?
Seems like a mirror image setup would work: your client app also sets up a
listener, and the service calls it when it has some stuff...
Feb 17 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: מורדי | last post by:
Hi, I'm writing a client/server application in which the client send a series of screenshots to the server to be saved using the tcpclient. in most cases the first screenshot is transmitted ok...
5
by: Greg Martz | last post by:
I'd like to do the following in C# and prefer using tcpclient rather than raw sockets... Connect to a unix box Login run date +%H%M%S retrieve the response. That's it, nothing more. This...
5
by: Horst Walter | last post by:
What is wrong here? IPAddress ipAddress = IPAddress.Parse("10.10.20.1"); IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, this.port); this.tcpClient = new TcpClient(ipEndPoint); // PROBLEM HERE...
3
by: Danny Tuppeny | last post by:
Hi all, I'm trying to send a null character as a string delimiter through a TcpClient (code below). It's to connect to this poker bot room: http://games.cs.ualberta.ca/webgames/poker/bots.html...
7
by: Pi | last post by:
I have an instance of a TcpClient using a NetworkStream and I want to be able to detect when the connection is lost (or cable unplugged). What is the best way of doing this? I don't want to use...
4
by: Haim | last post by:
it is very strange for me that a simple event of closing socket that was in the the winsock object of vb6 , i didn't found yet in the vb.net the only way i found is to try to send something to...
3
by: Ryan Liu | last post by:
Hi, I use Server: Use an endless thread to lisiten to clients requests: while(true) { TcpClient client = myListener.AcceptTcpClient();
1
by: WildBill | last post by:
I am using a tcpclient and a network stream to communicate with the TCP port on a printer for testing the printer firmware. The code I have works perfectly the first time I run it. The printer...
1
by: Mathijs | last post by:
Hi, I have a small Compact Framework tcpclient application (c#). This is my connection procedure: tcpclient = new TcpClient(ip, port); stream = tcpclient.GetStream(); Sent("HELLO");...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.