sockets problem

sockets problem

am 22.10.2007 03:10:58 von 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

Re: sockets problem

am 25.10.2007 19:01:20 von nobull67

On Oct 22, 2:10 am, "stanciuthe...@gmail.com"
wrote:
> 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.

Re: sockets problem

am 30.10.2007 18:03:37 von stanciutheone

On Oct 25, 7:01 pm, Brian McCauley wrote:
> On Oct 22, 2:10 am, "stanciuthe...@gmail.com"
>
> wrote:
> > 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.

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