Click here to Skip to main content
15,898,134 members
Home / Discussions / C#
   

C#

 
QuestionWhat is SMTP server? Pin
shdelpiero12-Feb-04 4:30
shdelpiero12-Feb-04 4:30 
AnswerRe: What is SMTP server? Pin
Heath Stewart12-Feb-04 5:02
protectorHeath Stewart12-Feb-04 5:02 
AnswerRe: What is SMTP server? Pin
Kentamanos12-Feb-04 8:57
Kentamanos12-Feb-04 8:57 
GeneralSelecting a specificTabPage... Pin
profoundwhispers12-Feb-04 4:30
profoundwhispers12-Feb-04 4:30 
GeneralRe: Selecting a specificTabPage... Pin
Heath Stewart12-Feb-04 4:52
protectorHeath Stewart12-Feb-04 4:52 
GeneralNull Pointer COM error - StrRetToStr Pin
Tristan Rhodes12-Feb-04 4:16
Tristan Rhodes12-Feb-04 4:16 
GeneralRe: Null Pointer COM error - StrRetToStr Pin
Nick Parker12-Feb-04 6:19
protectorNick Parker12-Feb-04 6:19 
GeneralHTML EMail with embedded images Pin
Braulio Dez12-Feb-04 4:14
Braulio Dez12-Feb-04 4:14 
GeneralRe: HTML EMail with embedded images Pin
Heath Stewart12-Feb-04 4:48
protectorHeath Stewart12-Feb-04 4:48 
GeneralRe: HTML EMail with embedded images Pin
Mazdak12-Feb-04 5:56
Mazdak12-Feb-04 5:56 
GeneralRe: HTML EMail with embedded images Pin
Nick Parker12-Feb-04 6:23
protectorNick Parker12-Feb-04 6:23 
GeneralRe: HTML EMail with embedded images Pin
Heath Stewart12-Feb-04 8:17
protectorHeath Stewart12-Feb-04 8:17 
GeneralHelp to TabControl / TabPage Pin
saabbaer12-Feb-04 4:03
saabbaer12-Feb-04 4:03 
GeneralRe: Help to TabControl / TabPage Pin
Heath Stewart12-Feb-04 4:13
protectorHeath Stewart12-Feb-04 4:13 
GeneralRe: Help to TabControl / TabPage Pin
saabbaer12-Feb-04 6:45
saabbaer12-Feb-04 6:45 
Questionhow to get cpu usage rate realtimely using C# Pin
yu-yu12-Feb-04 3:33
yu-yu12-Feb-04 3:33 
AnswerRe: how to get cpu usage rate realtimely using C# Pin
Heath Stewart12-Feb-04 4:10
protectorHeath Stewart12-Feb-04 4:10 
GeneralRe: how to get cpu usage rate realtimely using C# Pin
yu-yu12-Feb-04 13:01
yu-yu12-Feb-04 13:01 
GeneralXmlTextReader with a NetworkStream causes problems Pin
Borgbjerg11-Feb-04 23:00
Borgbjerg11-Feb-04 23:00 
We've got a multi-threaded server (we are very early in the project, trying to uncover some risks), and we want to send data using XML.

The class ServerAdapter is supposed to connect to the server (which works fine), to send data, but on the same stream be able to read data (which is causing problems).

In the function "bool Connect()", we want to instantiate the XmlTextReader with the stream that we got from the 'TcpClient client', but somehow that goes wrong. No exception is cast, but the problem definately has something to do with the stream that we get from the call 'client.GetStream()'.
When we try to do the exact same thing, with a stream NOT from a TcpClient, there is no problem. We've checked to see if it had something to do with the access-property on the connection (the 'Socket') on the serverside, but it came up negative. I am pretty much out of ideas, so if you can help me out, it'd be great (first time here, so I dont know the standarts)

We've checked how far it gets with text-outputs, so we KNOW that the XmlTextReader causes the problem.

Here is the part of code that fails.

public class ServerAdapter : IServerAdapter
{
private IServerEventHandler serverEventHandler;

private TcpClient client;
private NetworkStream stream;

private Thread readThread;

private XmlTextReader streamReader;
private XmlTextWriter streamWriter;
private BinaryReader reader;

private XmlValidatingReader validatingReader;
private XmlSchemaCollection schemaCollection;

public ServerAdapter()
{

}

public ServerAdapter( IServerEventHandler serverEventHandler ):base()
{
this.serverEventHandler = serverEventHandler;

}

public bool Connect()
{
bool connected = false;

try
{
client = new TcpClient();
client.Connect( "10.0.55.12", 4312 );

stream = client.GetStream();

streamReader = new XmlTextReader( stream );

streamWriter = new XmlTextWriter( stream, new System.Text.UTF8Encoding() );

blablabla....

Thanks in advance

...Borgbjerg

GeneralRe: XmlTextReader with a NetworkStream causes problems Pin
Heath Stewart12-Feb-04 4:04
protectorHeath Stewart12-Feb-04 4:04 
GeneralRe: XmlTextReader with a NetworkStream causes problems Pin
Borgbjerg12-Feb-04 4:30
Borgbjerg12-Feb-04 4:30 
GeneralRe: XmlTextReader with a NetworkStream causes problems Pin
Heath Stewart12-Feb-04 4:42
protectorHeath Stewart12-Feb-04 4:42 
GeneralGrant permission to access the Msysobjects Pin
Daminda11-Feb-04 21:18
Daminda11-Feb-04 21:18 
GeneralRe: Grant permission to access the Msysobjects Pin
Heath Stewart12-Feb-04 3:56
protectorHeath Stewart12-Feb-04 3:56 
GeneralImage into a database Pin
bengolong11-Feb-04 20:42
bengolong11-Feb-04 20:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.