Solved

Need socket example

Posted on 2006-10-19
2
325 Views
Last Modified: 2008-02-01
Hi, having alot of problems with async sockets and have kind of given up. If anyone can create a small sample of these features, points are yours.

I need a console application that is able to open up 2 connections to 2 _different_ servers, at the same time.

One should run on a thread and send "PING" to the server, once every xx seconds.
The other should just run normally as I'm expected to send commands to the stream - written from the console.

I don't mind what you use, TcpClient or Socket, aslong as both connections to the server's running until I close the application.

Some of the problems i'm having is doing while loops to keep reading for data, I always end up with only 1 line of data, then not being able to read anymore.

I've tried the async client socket example from MSDN, but it won't give a reply back. Server is sending '\0' char at the end I believe.

Thanks!
0
Comment
Question by:valvet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 500 total points
ID: 17769307
Did you read this sample:
http://www.microsoft.com/downloads/details.aspx?familyid=08e3d5f8-033d-420b-a3b1-3074505c03f3&displaylang=en

Asynchronous socket chat sample can be found in the CSharp.msi file - download and install it. It is quite simple and can help to write your own code. And it is really working.
0
 

Author Comment

by:valvet
ID: 17769663
Great resource. Have not seen that before.

Thank you!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question