sockets problem

S

stanciutheone

Hi,
my name is valentin and i'm trying to create a server using sockets,
the problem is that after i receive the data from the client i can't
send a message back if i will not send to the other clients the
message that the socket received, this problem i heaved also found in
a php application that i'm trying to develope,

if you need to see the source you can find it below:

http://pastebin.com/m30faafe4

Thank you, for helping me out
 
B

Brian McCauley

Hi,
my name is valentin and i'm trying to create a server using sockets,
the problem is that after i receive the data from the client i can't
send a message back if i will not send to the other clients the
message that the socket received, this problem i heaved also found in
a php application that i'm trying to develope,

if you need to see the source you can find it below:

http://pastebin.com/m30faafe4

I've downloaded that and after uncommenting the call to broadcast it
seems to do what it appears to be intended to do. (Which is to print
"USERLIST>matap" to all terminals whenever anyone enters a line
starting with a recognised command verb).
Thank you, for helping me out

You will have to give a better explanation of what your code is doing
and how this differs from your expectations.

You could also make it strict. This makes it much less difficult for
people who what to try to help you (including, of course, yourself).

Please see the posting guidelines.
 
S

stanciutheone

I've downloaded that and after uncommenting the call to broadcast it
seems to do what it appears to be intended to do. (Which is to print
"USERLIST>matap" to all terminals whenever anyone enters a line
starting with a recognised command verb).


You will have to give a better explanation of what your code is doing
and how this differs from your expectations.

You could also make it strict. This makes it much less difficult for
people who what to try to help you (including, of course, yourself).

Please see the posting guidelines.

sorry but i heaved found the problem was so:
-> when you receive the string from the socket you will need to delete
the last caracter because is \0

-> and you will need to send a string you will need to add a \0

Best Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,996
Messages
2,570,237
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top