#TCP Chat Application

61 messages · Page 1 of 1 (latest)

halcyon basinBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

tight chasm
#

I have all the code, just need to get it working

vale narwhal
#

expected? what did you expect?

#

why did you expect that?

tight chasm
#

Hello @vale narwhal

#

I'm not sure honestly, I'm trying to figure it out

#

I'm trying to understand why I can't get it running

#

I compiled TalkClient.c, Retrieve.H and DieWithError.c into one file
and
I compiled TalkServer.c, Retrieve.H and DieWithError.c into another one
I'm getting that error when using it

vale narwhal
#

does say 'it'. be specific.

tight chasm
#

Sorry, I'm trying to understand how to use the client
I think I'm using it appropriately based upon syntax
When I enter
"./client 10.182.0.2 hello user1" on the client side,
I get
"----------------------------------------------------------------
Segmentation fault"

#

Would you be able to compile the files like I did, and see what you get on your end?

vale narwhal
#

seg fault is a memory issue.. that's just bad coding. i thought you were ok coder, but just didn't read sendto() docs properly.

tight chasm
#

Sorry, I guess my first issue is that I'm confused on the usage for the client
When I run it, and attempt to check it
it returns
"Usage: ./client <Server IP> <Echo Word> [<Echo Port>] <UserID> <TCP Port>"
So I'm not sure if I'm using it correctly

#

Can you tell me if I'm using it properly?

vale narwhal
#

too much src. run it in debugger, and find the line that segfaults

tight chasm
#

Do you mind if we go over the usage of client first?

vale narwhal
#

i see piles of functions without error checking; nonsense statments like while(1), when while takes a bool expression. teh code needs to be completed first.

#

lots of un-init'd vars 😦

halcyon basinBOT
#

@tight chasm Has your question been resolved? If so, run !solved :)

tight chasm
#

no

halcyon basinBOT
#

@tight chasm

Please Do Not Delete Posts!

Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. You can use !solved to close a post and mark it as solved.

tight chasm
#

@vale narwhal
The code is now working, however it is not working as intended
2 clients connected to the server are unable to communicate with each other

vale narwhal
#

my internet is due to go offline in 30 sec for 1hr.

tight chasm
#

ok

#

Can you help me later?

vale narwhal
#

maybe.

#

you took code links away

tight chasm
#

Oop, let me paste

vale narwhal
#

error text suggests a misunderstanding of how TCP works

#

there is no "message"

#

there is only a stream of bytes.

#

sometimes 1, sometimes all of them

#

sometimes 1/2 of them, then a delay, then the other 1/2 in the next call

tight chasm
#

I'm not getting an error though...

vale narwhal
#

probably only by chance

tight chasm
#

You're not very helpful

#

!NOTRESOLVED

pine loom
#

Then, you're helpless.

tight chasm
#

<@&847915341954154536>

bronze dirge
#

Hi

pine loom
#

Don't you dare telling someone "You're not very helpful" just because you're dissatisfied with their resolve.

tight chasm
#

Hello, can I please have some help?

bronze dirge
#

At this point please ask a new question.

tight chasm
#

ShadowDragon is being mean

#

Ok

halcyon basinBOT
#
How to Ask A Programming Question

Anyone can ask a question in our programming channels.
Following the guide
Writing The Perfect Question
is recommended.

What To Post

State your problem clearly and provide all necessary details:

  • the relevant portion of your code, or all of it
  • the expected output
  • the actual output (or the full error)
    🏆 Gold Standard: Minimal Reproducible Example
Where To Post

Provide the relevant code in the message, and format it nicely with a code block*.
If it's too much for one message, you can upload it:

  • Compiler Explorer for most C/C++ snippets
  • OnlineGDB for interaction, debugging
    Do not post screenshots, let alone photos of your screen!
barren dome
#

Firstly, don't ping moderators because you aren't happy with the help you were given

tight chasm
#

No, it wasn't that
I felt attacked

bronze dirge
barren dome
#

You're not being attacked, but you aren't helping yourself get helped either

#

Read the snippet above on how to ask a good question

tight chasm
#

Sure thing

bronze dirge
#

And please be patient with people trying to help

tight chasm
#

I felt like his remarks were mean and out of line, but my apologies
I asked for help and he just verbally assults me, is how I felt

barren dome
#

I mean, you're the first one that started throwing out-of-line comments

#

"You're not very helpful" and "!NOTRESOLVED"

pine loom
#

People can feel whatever they want. If you're one of the unfortunate "minorities", this place is not for you, a narcissist.

tight chasm
#

This is what I meant

barren dome
#

Calling people narcissists is also out of line

bronze dirge
#

Not sure what minorities have to do with anything here