Hrm I use a Serial port server to do that..
such as these devices from
SENA or
quatech
Since most devices I would use that feature with are not something I would have connected to a Large PC directly, these compact devices usually suit my needs better.
Best of luck writing this code.. Obviously it can be done since these commercial projects are doing it.
although they receive the serial data on a physical serial port then encapsulate the data in the IP packets and are not trying to intercept it inside the PC.. The far end has a client on the PC to convert the data back.