Ticket #86 (closed defect: wontfix)

Opened 6 years ago

Last modified 6 years ago

Use on socket connections with non blocking flag set

Reported by: oscar.ostlund@… Owned by: xi
Priority: normal Component: libyaml
Severity: normal Keywords:


I am trying to use yaml as a communication language between processes that are connected through sockets. When I open sockets, I use non blocking sockets. Thus when libyaml tries to read the file with fread, it returns an error. Indeed, as the non blocking flag is set, when there is nothing more to read, the fread call returns EWOULDBLOCK.

As a hack, I have modified the yaml_file_read_handler function to return 1 if errno == EWOULDBLOCK and !ferror in the other cases...

What do you think ?

Thanks for your help



Change History

comment:1 Changed 6 years ago by xi

  • Status changed from new to closed
  • Resolution set to wontfix

I think it is better if you define a custom read handler and register it with yaml_parser_set_input(). You may use the code of yaml_file_read_handler() as a start. The standard file read handler is supposed to be used for simple tests and examples. For a networking application, it is better to define a specialized read handler.


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.