Top Mud Sites Forum

Top Mud Sites Forum (http://www.topmudsites.com/forums/index.php)
-   MUD Coding (http://www.topmudsites.com/forums/forumdisplay.php?f=9)
-   -   Issue collecting input from blowtorch (http://www.topmudsites.com/forums/showthread.php?t=7804)

ThunderZ 04-18-2019 07:14 PM

Issue collecting input from blowtorch
 
I recently added Kavir's protocol handler to my MUD (based on SocketMUD) and for some odd reason ALL other clients work perfectly fine...except for BlowTorch(Android MUD client).

I can't figure out why but when you try to input anything into the mud from Blowtorch..Blowtorch ****s itself...freezes and eventually crashes and the phone must be rebooted or force close blowtorch.

From what I can tell it from the read_from_socket() function

What am I doing wrong? Help PLEASE! lol.

Edit: Specifically it seems to be an issue with the way im calling read() I think..


Istarian 05-07-2020 02:59 PM

Re: Issue collecting input from blowtorch
 
How do you figure it's an error reading from the socket? Are you seeing that log string or perror call in a way that is unambiguously from the specific connection/socket that the Android (Blowtorch) client is connected to?

Tangentially, if you don't know why there's an absolute adjustment of 10 bytes you might want to figure that out.







Looks like you're actually using pread from unistd.h based on the format... or maybe it's the read POSIX call...

Presumably you're trying to read one byte at a time from the network socket into read_buf until you hit the end of a line and tracking total read bytes insize. Based on the pread documentation it looks like the second parameter should be a fixed number of bytes to read from the offset on... So I'm not sure what 'read_buf + size' is supposed to be; is it really supposed to change with the size and what value do you imagine 'read_buf' to have?

If it's the POSIX read call you mean I think maybe it should be:

because that second parameter is supposed to be a pointer to the buffer... My C is probably rusty though and pointer arithmetic..


All times are GMT -4. The time now is 12:24 AM.

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Top Mud Sites.com 2022