so can do something like this:
typedef struct {
char buff[102400];
int length;
int fd;
} Block;
Type: Posts; User: ueg1990
so can do something like this:
typedef struct {
char buff[102400];
int length;
int fd;
} Block;
hey, i am trying to implement the function nfs_write(int fd, char* buff, int length) for my network file system. This function is supposed to write bytes to the file and return the number of bytes ...
i) so i shud create a struct on the client side which will keep track of all the file descriptors for each file in the server side??
ii) also, one of the requirements of the assign is: "You must...
hello dmh2000, another quick ques....for functions like nfs_close, nfs_write and nfs_read, the only info i have to identify which file to close, write or read is the file descriptor. does that mean...
u r too awesome!!! thank u!!!! and that sequence u predicted was spot on!!!! :D
hello dmh2000, thnx for the reply!! i am stuck in another function but only bcuz im not sure what is the expected result. the function is nfs_open(char *filesys, char *name) which opens the given...
i am trying to implement a network file system as part of an assign in C: the file system is on the server side and i have to send commands from the client side.
i have implemented my client and...
thnx alot guys.....that was really helpful!!!!
hello,
i know its a basic question on pointers/malloc , but i wud still like if u can explain y in the following code we need to allocate memory to str2 and str3 be4 using strcpy and memcpy??
...
why will it be a hard time integrating select and poll??
also, i used fork() to enable full duplex communication....is that ok too?? or is the select/poll method a better solution??
here is my code. this is the farthest i have reached. i just want to now figure out full duplex btw client and server like chatting
Client:
#include <stdio.h>
#include <stdlib.h>...
hello, i am trying to implement a client and server program. i have managed to establish one way communication btw client and server where server can continuously receive messages from client until...
if the file descriptor that we get from accept is for a new connection, then whats the use of the file descriptor from socket()? is it only for associating it to a specific socket??
one quick ques abt the server side in client/server implementation: there are two file descriptors....is it important to closr both file descriptors when closing the connection??
yes, that was the mistake!!! thnx alot!!
i am able to now send and receive messages but only one at a time!!
how can i maintain a continuous connection?? so that if i send anything via client the...
since i am running both client and server on same machine, i run my program as:
for server:
gcc -o server ue_server.c
./server
for client:
gcc -o client ue_client.c
./client 127.0.0.1
i did that but still no result.
the error i am getting is on server side:
recv: Socket operation on non-socket
any other suggestions?? i am only one step away from establishing my...
hello,
i am trying to implement a tcp client and tcp server. i am able to establish the connection but when i send a message from client, the server is not able to receive it. here is my code...
nope, i am in the linux world right now!! :)
just one ques: i want to implement a client and server program and want to run client and server one two separate computers. will this loopback address...
so is there any other way of getting my actual ip address from my code?? i do not know what i am missing!!
hello,
i was able to get ip address using gethostname and gethostbyname functions but since they are now superseded by getaddrinfo() i wanted to get ip address using this function.
here is my...
i have the exact same ques as surajkaul w,r,t to coding. except i was considering Java instead of C++.....advice from the programming experts wud be really appreciated!!!
hello,
can u explain what memcpy() does?
and what is the difference btw memcpy() and memset()?
oh ok...thnx!!
btw nice quote!!!
So, if we do not malloc, it will not copy from s to p?