473,396 Members | 1,892 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,396 software developers and data experts.

Socket Example Wanted


Does anyone know of a good asynchronous socket exsample. There are some
exsamples in the documentation and around on the net. But they are all in
the same way: The server reseived a connection from the client, read
something and send something back.

A need an exsamlple were a client connect´s to a server, and then the
connection is kept up. The client can then send data to the server when ever
it whant to. But the Server can also send data to the client when ever it
want to.

The Connection can then be disconnected by the Client.

I hope someone can understand me, and se how this exsample differs from the
examples out there.

If someone can desripe how to make such a solution they are also welcome.
Dont you need to make a Thread on the server representing each client ?

Best Regards

Anders Both , Denmark.
Nov 15 '05 #1
2 1082

"Anders Both" <an********@hotmail.com> wrote in message
news:eh**************@TK2MSFTNGP12.phx.gbl...

Does anyone know of a good asynchronous socket exsample. There are some
exsamples in the documentation and around on the net. But they are all in
the same way: The server reseived a connection from the client, read
something and send something back.

A need an exsamlple were a client connect´s to a server, and then the
connection is kept up. The client can then send data to the server when ever it whant to. But the Server can also send data to the client when ever it
want to.


Have you seen the example at
http://msdn.microsoft.com/library/en...blockingserver
socketexample.asp? It does disconnect from the client eventually (of
course) but not until the client signals that it is done with the
conversation by sending "<EOF>". Until that happens, it should maintain the
connection and you should be able to process multiple requests from the
client. You can pull out the disconnect code from the Send() method and put
it into it's own method so that you can make multiple responses back to the
client over the duration of the connection.

Nov 15 '05 #2
Thx, I saw that exsample but still I would like some more exsample. But
anyway in the meantime I am begining to understand everything.

Best Regards

"Bret Mulvey [MS]" <br***@online.microsoft.com> wrote in message
news:#l**************@tk2msftngp13.phx.gbl...

"Anders Both" <an********@hotmail.com> wrote in message
news:eh**************@TK2MSFTNGP12.phx.gbl...

Does anyone know of a good asynchronous socket exsample. There are some
exsamples in the documentation and around on the net. But they are all in the same way: The server reseived a connection from the client, read
something and send something back.

A need an exsamlple were a client connect´s to a server, and then the
connection is kept up. The client can then send data to the server when ever
it whant to. But the Server can also send data to the client when ever it want to.


Have you seen the example at

http://msdn.microsoft.com/library/en...blockingserver socketexample.asp? It does disconnect from the client eventually (of
course) but not until the client signals that it is done with the
conversation by sending "<EOF>". Until that happens, it should maintain the connection and you should be able to process multiple requests from the
client. You can pull out the disconnect code from the Send() method and put it into it's own method so that you can make multiple responses back to the client over the duration of the connection.

Nov 15 '05 #3

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

Similar topics

4
by: Fuzzyman | last post by:
In a nutshell - the question I'm asking is, how do I make a socket conenction go via a proxy server ? All our internet traffic has to go through a proxy-server at location 'dav-serv:8080' and I...
3
by: ferbar | last post by:
Hello all, This may sound pretty basic stuff.. but I'm working on a socket example whose client seems to work fine, but the server doesn't send to the client the expected result. The problem is...
5
by: John Sheppard | last post by:
Hi all, I am not sure that I am posting this in the right group but here it goes anyway. I am new to socket programming and I have been searching on the internet to the questions I am about to pose...
1
by: John Sheppard | last post by:
Thanks to everyone that responded to my previous Socket Programming question. Now I have run into some behavior that I don't quite understand. Programming environment. VS.NET 2003, C#, Windows...
4
by: rs | last post by:
how I the client tell the server that the socket is closed? or this there an even that informs the server that the clients socket is close? Oh, I am using vb.net 2003 Thanks
9
by: Macca | last post by:
Hi, I have a synchronous socket server which my app uses to read data from clients. To test this I have a simulated client that sends 100 byte packets. I have set up the socket server so...
2
by: djc | last post by:
I read a network programming book (based on framework 1.1) which indicated that you should 'never' use the RecieveTimeout or the SendTimeout 'socket options' on TCP sockets or you may loose data. I...
3
by: BuddyWork | last post by:
Hello, Could someone please explain why the Socket.Send is slow to send to the same process it sending from. Eg. Process1 calls Socket.Send which sends to the same IP address and port, the...
0
by: Buddy Home | last post by:
There is two examples of code. Example 1. Send and Receive within the same process. Put this code in a console app called SendAndReceive and run the code. using System; using...
10
by: ThunderMusic | last post by:
Hi, I'm currently working with sockets. I accept connections using m_mySocket.Listen(BackLogCount); But when I want to stop listening, I shutdown all my clients and call m_mySocket.Close(), but it...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.