Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Need socket example

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

Industry Leaders: 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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

604 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