Dear All,
I am new in this forum and also relatively new to .Net. I need to create an application which needs to be able to act as a network server and provide data and messages to a variety of clients including IMAP email clients.
I am using Visual C# and .Net version 2.0.
The .NET socket interface looks somewhat easy but it there seems little control of the details. I can not design both sides of the network comm, i.e. my server must be able to connect to any TCP client written by whoever - so I must can not implement simple application layer protocols but rather must rely only on for example what the IMAP or HTTP RFCs say.
Two key problems I would like some help with is:
(1) I need network events so that I can initiate a READ on sockets when network data arrives. Having to get a thread looping all the time to check seems wasteful to me. I cannot find any such network event.
(2) I am getting / sending limited size messages (i.e. it's not Megabytes) over the network but can not include total message size into the data. However, TCP/IP knows when all the packets of a certain messages have been transmitted and the transmission of that specific message is completed and acknowledged as far as TCP is concerned. However, this info seems unavailable on the programmer level in .NET. Or isnt it?
I can keep checking for socket.Availabl e() in my code but I must know that a specific message is now over, and that the next data now Available() is actually a new message.
I already searched MSDN and the .NET Help but seems nothing documented.
Any hint is appreciated.
Regards
Peter
I am new in this forum and also relatively new to .Net. I need to create an application which needs to be able to act as a network server and provide data and messages to a variety of clients including IMAP email clients.
I am using Visual C# and .Net version 2.0.
The .NET socket interface looks somewhat easy but it there seems little control of the details. I can not design both sides of the network comm, i.e. my server must be able to connect to any TCP client written by whoever - so I must can not implement simple application layer protocols but rather must rely only on for example what the IMAP or HTTP RFCs say.
Two key problems I would like some help with is:
(1) I need network events so that I can initiate a READ on sockets when network data arrives. Having to get a thread looping all the time to check seems wasteful to me. I cannot find any such network event.
(2) I am getting / sending limited size messages (i.e. it's not Megabytes) over the network but can not include total message size into the data. However, TCP/IP knows when all the packets of a certain messages have been transmitted and the transmission of that specific message is completed and acknowledged as far as TCP is concerned. However, this info seems unavailable on the programmer level in .NET. Or isnt it?
I can keep checking for socket.Availabl e() in my code but I must know that a specific message is now over, and that the next data now Available() is actually a new message.
I already searched MSDN and the .NET Help but seems nothing documented.
Any hint is appreciated.
Regards
Peter
Comment