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

A litle problm with message sent

I now have a client and a server accepted connection

Here is the code that server accept message from client after connect

try{
TcpClient client=new Tcpclient(add,port);
bytes[] by=new bytes[256];
Networkstream s=client.GetStream();
int b=s.read(by,0,by.length);

String msg=Encoding.Ascii.getstring(by,0,b);
console.writeline("{0}",msg);
client.close();
}

catch(exceptoin){something}
And from client
TcpClient client=new TcpClient(add,port);
if(connected){
string s="*~HAPPY* CHRISTMAS *_*EVERYONE*~ !!*!*!!*";
Networkstream stream=client.getstream();
Byte[] data=Encoding.Ascii.getbytes(s);

stream.write(data,0,data.length)
console.write("{0}",s)
}
There is no message set from client on Server edit box
Please fix it please, very urgent need

Dec 12 '06 #1
1 1017
Alakhim Mohamad <al*******@yahoo.co.idwrote:
I now have a client and a server accepted connection

Here is the code that server accept message from client after connect
<snip>

Those certainly *aren't* the real bits of code, as they wouldn't
compile due to case problems. It would be much better to see the *real*
code.

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Dec 13 '06 #2

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

Similar topics

5
by: Philip Ronan | last post by:
OK, here's my 2p worth: === Q. Why am I getting the error message 'Headers already sent'? A. PHP produces this error message when you try to set a header for a web page after you have already...
2
by: Jagdip Singh Ajimal | last post by:
I have setup an email notifications system, that basically takes each row from a table and sents out an email according to the data in that row. The emails get sent, with the subject being filled...
13
by: Boris Glawe | last post by:
Hi, I am going to write a client/server based application with for Linux in C++. I am programming C++ on purpose. There are many tutorials out there how to create a new socket, and receive and...
2
by: Janna Deegan | last post by:
Hello all, First off, if there is a better place to post for an answer to this question, please feel free to point me there. I have some very strange behavior happening with my System.web.mail...
16
by: whyyyy | last post by:
The script below works fine if the form is filled out and submitted. But a (blank) e-mail is sent whenever the page loads, even when the form is not submitted. I would like to receive the e-mail...
2
by: CorfuVBProgrammer | last post by:
I have create a very simple program in my Visual Basic 2005 Pro. I retrive some records from my database and then i have bind some text fields to that data. When the application starts then...
7
by: Guy Davidson | last post by:
Hi Folks, I'm having some issues with an small socket based server I'm writing, and I was hoping I could get some help. My code (attached below) us supposed to read an HTTP Post message...
6
by: simon2x1 | last post by:
the code below is my mail code its working but message sent to the email is going to the spam mail not the inbox how can make the message go to indox <?php require_once("connect.php"); //...
7
by: marybarkerharris | last post by:
I have created an online form for users of my website to complete and wish to limit the time allowed for completion. I think I may need to use "settimeout" but none of the examples I can find...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.