Click here to Skip to main content
15,918,258 members
Home / Discussions / C#
   

C#

 
GeneralRe: Things are not working as expected Pin
Jon G26-Apr-04 5:20
Jon G26-Apr-04 5:20 
GeneralRe: Things are not working as expected Pin
gUrM33T26-Apr-04 5:29
gUrM33T26-Apr-04 5:29 
GeneralRe: Things are not working as expected Pin
gUrM33T26-Apr-04 5:24
gUrM33T26-Apr-04 5:24 
GeneralRe: Things are not working as expected Pin
Heath Stewart26-Apr-04 5:53
protectorHeath Stewart26-Apr-04 5:53 
GeneralRe: Things are not working as expected Pin
gUrM33T26-Apr-04 15:30
gUrM33T26-Apr-04 15:30 
GeneralRe: Things are not working as expected Pin
Heath Stewart27-Apr-04 2:39
protectorHeath Stewart27-Apr-04 2:39 
QuestionSplitting a string into a substring and into chars? Pin
Eolus26-Apr-04 5:03
Eolus26-Apr-04 5:03 
GeneralProblem With tcpclient.GetStream() Pin
Tarakeshwar26-Apr-04 1:15
Tarakeshwar26-Apr-04 1:15 
Hi All,

I am writing a code to transmit data from a client to a server using sockets. The first data transmitted from the client to the server gets transmitted, after that I get a error when I attempt to send a 2nd set of data. It says "Operation not allowed on non-connected sockets". Part of my code is

Client Code:

private void TcpDataSendTransmitter()
{
/*This is line which is giving me the error*/
networkStream = tcpClientListner.GetStream();
streamWriter = new System.IO.StreamWriter(networkStream);
streamReader = new System.IO.StreamReader(networkStream);
try
{
string temp = txtData.Text;
streamWriter.WriteLine(temp);
streamWriter.Flush();
listBoxClient.Items.Add(temp);
}
.
.
.
}

Server code:

if(clientSocketListener.Connected)
{
NetworkStream networkStream = new NetworkStream(clientSocketListener);
System.IO.StreamWriter streamWriter = new System.IO.StreamWriter (networkStream);
System.IO.StreamReader streamReader = new System.IO.StreamReader(networkStream);
streamWriter.WriteLine("Server: Your Are Connected");
streamWriter.Flush();
temp = streamReader.ReadLine().ToString();
listBoxServer.Items.Add(temp);
}

What could be the possible Solution for this.

Regards
Tarakeshwar
GeneralRe: Problem With tcpclient.GetStream() Pin
Heath Stewart26-Apr-04 3:24
protectorHeath Stewart26-Apr-04 3:24 
GeneralRe: Problem With tcpclient.GetStream() Pin
Tarakeshwar26-Apr-04 4:08
Tarakeshwar26-Apr-04 4:08 
GeneralRe: Problem With tcpclient.GetStream() Pin
Heath Stewart26-Apr-04 4:20
protectorHeath Stewart26-Apr-04 4:20 
GeneralOOP help Pin
Atazoth26-Apr-04 0:31
Atazoth26-Apr-04 0:31 
GeneralRe: OOP help Pin
Heath Stewart26-Apr-04 3:21
protectorHeath Stewart26-Apr-04 3:21 
GeneralRe: OOP help Pin
Jeff Varszegi26-Apr-04 3:44
professionalJeff Varszegi26-Apr-04 3:44 
GeneralA new open-source filebrowser Pin
Jonathan Slenders26-Apr-04 0:25
Jonathan Slenders26-Apr-04 0:25 
Generalobject oriented program help Pin
Anonymous26-Apr-04 0:10
Anonymous26-Apr-04 0:10 
GeneralDatagrid and dataset Pin
Appelz25-Apr-04 23:09
Appelz25-Apr-04 23:09 
GeneralRe: Datagrid and dataset Pin
DougW4826-Apr-04 17:19
DougW4826-Apr-04 17:19 
GeneralRe: Datagrid and dataset Pin
Jay Shankar26-Apr-04 21:58
Jay Shankar26-Apr-04 21:58 
GeneralRe: Datagrid and dataset Pin
Appelz26-Apr-04 23:50
Appelz26-Apr-04 23:50 
GeneralRe: Datagrid and dataset Pin
Jay Shankar29-Apr-04 15:04
Jay Shankar29-Apr-04 15:04 
Questionhow can i get dates pupup from db ? Pin
kings_125-Apr-04 22:26
kings_125-Apr-04 22:26 
GeneralCompression Algoritm Pin
yarns25-Apr-04 22:09
yarns25-Apr-04 22:09 
GeneralDetecting when 'this' assembly gets loaded Pin
Arthur van der Wal25-Apr-04 22:08
Arthur van der Wal25-Apr-04 22:08 
GeneralRe: Detecting when 'this' assembly gets loaded Pin
pdohara28-Oct-08 5:09
pdohara28-Oct-08 5:09 

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.