?
Solved

Need socket example

Posted on 2006-10-19
2
Medium Priority
?
327 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 2000 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

771 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