© 2014 Firstsoft Technologies (P) Limited. login
Hi 'Guest'
Home SiteMap Contact Us Disclaimer
enggedu
Quick Links
Easy Studies

Home Lab Exercise Network Lab Exercise Programs Transferring Files Over RS232 ▼


Transferring Files Over RS232

Algorithm Steps:

Server:

1. Start.

2. Open the file recvfile.txt in write mode.

3. Receive the port number and establish socket connection.

4. Listen to client’s request using system call listen() .

5. While the message size is not zero, receive the client message and write it in to a file.

6. Close the socket connection,

7. Stop.

Client:

1. Start.

2. Pass server address and file name as command line arguments.

3. Open the file and establish connection using socket().

4. Using memset(), get the size of client address.

5. Connect to server using connect()system call.

6. While not end of file, print the contents into the file.

7. Close the socket connection.

8. Stop.

Syntax:

1. socket()
socket(protocol family, type of socket, protocol);

2. connect()
connect(client socketid, client address, length of server address);

3. send()
send(int s, void $buf, size_tlen, int flags);

4. recv()
recv(int s, void $buf, size_tlen, int flags);

5. listen()
listen(server socket, protocol type for number of connection) ;

6. accept()
accept(socket id, client information, client size);

C Program To Transfer Files Over RS232

 
SLogix Student Projects
bottom