Well i learned this on emonth back in Computer Networks. For this you will need to programs one server and other reciver. the coding of which i give below:: Here i will mention the coding for transmitting a character. If you still need to transmiot a file tell me, i will try to send you the program for it as well.
Server:
#include <stdio.h>
#include <dos.h>
#include<conio.h>
int main(void)
{
int port = 0;
char value = 'A';
char result;
clrscr();
outport(port, value);
printf("Value %c sent to port number %d\n", value, port);
getch();
result=inport(port);
printf("Received value is %c",result);
getch();
} Client:
#include <stdio.h>
#include<dos.h>
#include<conio.h>
void main()
{
char result;
clrscr();
outport(0x2fb,0x87);
outport(0x2f8,0x0c);
outport(0x2f9,0x00);
outport(0x2fb,0x07);
if(inport(0x2fd)!=0x61)
{
result=inport(0x2f8);
printf("your character has been received:%c", result);
}
getch();
}