Ticket #496 (closed patch: fixed)

Opened 5 years ago

Last modified 5 years ago

[PATCH] Resurrect socket io (unix only)

Reported by: bacek Owned by:
Priority: normal Milestone:
Component: core Version:
Severity: fatal Keywords: sockets
Cc: Language:
Patch status: applied Platform: linux

Description (last modified by jkeenan) (diff)

Hello.

There is patch for bringing socket IO back to parrot. Unix-only version, because I doesn't have any Windows specific devtool available...

-- Bacek

Attachments

socket.patch Download (49.6 KB) - added by bacek 5 years ago.
Sockets patch
MANIFEST-socket.patch Download (1.2 KB) - added by doughera 5 years ago.

Change History

Changed 5 years ago by bacek

Sockets patch

  Changed 5 years ago by whiteknight

  • severity changed from medium to low
  • component changed from none to core
  • patch set to new
  • platform set to linux
  • keywords sockets added
  • type changed from bug to RFC

It's my understanding that we're not going to go the route of socket-specific opcodes anymore. Instead, I think the intention is to create a Socket (or "SocketHandle", or something) PMC class that will work analogously to the current FileHandle PMC.

  Changed 5 years ago by jonathan

  • status changed from new to closed
  • resolution set to fixed

Applied in r37705. I also did a port to Win32, which almost works. (Will send mail about that in a moment.)

Note to Whiteknight on the opcodes - yes, I wondered about those too, but as bacek pointed out the IO PDD does specify that they should be there. And since the PDD was reviewed fairly recently, I'm going to assume it's correct. If it's wrong, then it can be changed and the ops ripped out too.

Many thanks to bacek++ for this patch - Rakudo folks have been longing for sockets in recent weeks, so I'm very happy that somebody has done the underlying Parrot work to let us get that in place.

Thanks,

Jonathan

  Changed 5 years ago by coke

  • status changed from closed to reopened
  • type changed from RFC to patch
  • resolution fixed deleted
  • patch changed from new to applied

FYI, This patch breaks 'make codetest'; ticket can be re-closed when that passes again.

follow-up: ↓ 5   Changed 5 years ago by doughera

  • severity changed from low to fatal

I've bumped this to 'fatal' because it completely breaks the build for me, both on Solaris and on Linux/x86. Here's the relevant output of make:

src/io/socket_api.c: In function 'Parrot_io_new_socket_pmc':
src/io/socket_api.c:244: error: 'enum_class_Socket' undeclared (first use in this function)

This is with a plain perl Configure.pl && make on Linux/x86.

in reply to: ↑ 4 ; follow-up: ↓ 6   Changed 5 years ago by bacek

Replying to doughera:

I've bumped this to 'fatal' because it completely breaks the build for me, both on Solaris and on Linux/x86. Here's the relevant output of make: {{{ src/io/socket_api.c: In function 'Parrot_io_new_socket_pmc': src/io/socket_api.c:244: error: 'enum_class_Socket' undeclared (first use in this function) }}} This is with a plain perl Configure.pl && make on Linux/x86.

Did you try "make realclean" before running Configure?

-- Bacek

in reply to: ↑ 5 ; follow-up: ↓ 8   Changed 5 years ago by doughera

Replying to bacek:

This is with a plain perl Configure.pl && make on Linux/x86.

Did you try "make realclean" before running Configure?

Yes. I deleted my whole working directory and rebuilt it fresh from an up-to-date svn checkout.

[time passes]

Ok. I've figured it out. There were files missing in MANIFEST. I've attached a patch to fix MANIFEST. (I use MANIFEST to make copies of the parrot tree to use for compilation.)

Changed 5 years ago by doughera

  Changed 5 years ago by jkeenan

  • summary changed from [PATCH] Ressurect socket io (unix only) to [PATCH] Resurrect socket io (unix only)

in reply to: ↑ 6   Changed 5 years ago by jkeenan

Replying to doughera:

Ok. I've figured it out. There were files missing in MANIFEST. I've attached a patch to fix MANIFEST. (I use MANIFEST to make copies of the parrot tree to use for compilation.)

I just updated MANIFEST, which caught these 3 missing files, plus 1 other.

follow-up: ↓ 10   Changed 5 years ago by jkeenan

  • description modified (diff)

I did a lot of fixing of these files to make them conform to our coding standards. But there was one case where what I did caused make to fail.

In src/io/socket_unix.c, the following line was judged to fail c_macro_args.t.

#  define SOCKADDR(p, t) ((struct sockaddr_in*)VTABLE_get_pointer(interp, PARROT_SOCKET((p))->t))

But changing it to the following caused make to fail:

#  define SOCKADDR(p, (t)) ((struct sockaddr_in*)VTABLE_get_pointer(interp, PARROT_SOCKET((p))->t))

So I reverted and, as a precaution, did so also in src/io/socket_win32.c. Can someone more familiar with this take a look?

Thank you very much.
kid51

in reply to: ↑ 9   Changed 5 years ago by bacek

Replying to jkeenan:

I did a lot of fixing of these files to make them conform to our coding standards. But there was one case where what I did caused make to fail.

I've created patch which was applied in r37735. Ticket can be closed now.

-- Bacek

  Changed 5 years ago by jkeenan

  • status changed from reopened to closed
  • resolution set to fixed

bacek: Thanks for this significant contribution. Closing ticket.

Note: See TracTickets for help on using tickets.