here's my two cents: "you just have to do as if in a file copy program" ;
- that's the whole idea behind sockets ... once a connection is established , it's just another good ol' file i/o thing !
- the only detail you should bear in mind is that the default packet size is 1500 bytes, and it's no use reading(receiving) or writing(sending) chunks bigger than this ;
(remember : this is plain bread-and-butter default conditions - for newbies - and anything more complicated than this can be done with proper study)
finally, some sample code (for the client who sends the file):
I am in a Systems programming class this semester, and our current project is to write a program utilizing sockets and fork. For the project, I decided to make my own instant messaging program. I have the code completed, but I have a problem that keeps old clients from communicating with new... (3 Replies)
Hi
I want to sent attachment file which is 400mb size.(single file, not tar file)
is there any way that these kind of large files can be divided into small sizes and sent as attachments
thanks with anticipation (3 Replies)
Hai Friends
I am writing a c program to transfer files from one system to another using TCP/IP socket programming..
My Recieve Program
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
extern int errno;
extern char *sys_erlist;
void... (2 Replies)
Hello there !!!!!!!!! I got some problems trying to transfer a file through sockets.
The Server must be in Java and the Client in C++
I came up with this code for the server :
BufferedInputStream input;
BufferedOutputStream output;
public void send_data() throws IOException
{
... (7 Replies)
Hello Gurus,
We are facing some performance issue in UNIX. If someone had faced such kind of issue in past please provide your suggestions on this .
Problem Definition:
/Few of load processes of our Finance Application are facing issue in UNIX when they uses a shell script having below... (19 Replies)
Hi-
I am trying to search a large file with a number of different search terms that are listed one per line in 3 different files. Most importantly I need to be able to do a case insensitive search.
I have tried just using egrep -f but it doesn't seam to be able to handle the -i option when... (3 Replies)
I have a very large system generated file containing around 500K rows size 100MB like following
HOME|ALICE STREET|3||NEW LISTING
HOME|NEWPORT STREET|1||NEW LISTING
HOME|KING STREET|5||NEW LISTING
HOME|WINSOME AVENUE|4||MODIFICATION
CAR|TOYOTA|4||NEW LISTING
CAR|FORD|4||NEW... (9 Replies)
Hi,
Anyone can help, I have a large textfile (one file), and I need to split into multiple file to break each file into ^L.
My textfile
==========
abc company
abc address
abc contact
^L
my company
my address
my contact
my skills
^L
your company
your address
========== (3 Replies)
Dear Users,
Appreciate your help if you could help me with splitting a large file > 1 million lines with sed or awk. below is the text in the file
input file.txt
scaffold1 928 929 C/T +
scaffold1 942 943 G/C +
scaffold1 959 960 C/T +... (6 Replies)
Discussion started by: kapr0001
6 Replies
LEARN ABOUT CENTOS
shutdown
SHUTDOWN(2) Linux Programmer's Manual SHUTDOWN(2)NAME
shutdown - shut down part of a full-duplex connection
SYNOPSIS
#include <sys/socket.h>
int shutdown(int sockfd, int how);
DESCRIPTION
The shutdown() call causes all or part of a full-duplex connection on the socket associated with sockfd to be shut down. If how is
SHUT_RD, further receptions will be disallowed. If how is SHUT_WR, further transmissions will be disallowed. If how is SHUT_RDWR, further
receptions and transmissions will be disallowed.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
EBADF sockfd is not a valid descriptor.
EINVAL An invalid value was specified in how (but see BUGS).
ENOTCONN
The specified socket is not connected.
ENOTSOCK
sockfd is a file, not a socket.
CONFORMING TO
POSIX.1-2001, 4.4BSD (the shutdown() function call first appeared in 4.2BSD).
NOTES
The constants SHUT_RD, SHUT_WR, SHUT_RDWR have the value 0, 1, 2, respectively, and are defined in <sys/socket.h> since glibc-2.1.91.
BUGS
As currently implemented, checks for the validity of how are done in domain-specific code, and not all domains perform these checks. Most
notably, UNIX domain sockets simply ignore invalid values; this may change in the future.
SEE ALSO connect(2), socket(2), socket(7)COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2012-09-06 SHUTDOWN(2)