further info, on annoying bug
This function works and creates the socket ok and connects
int connects(char *server, char *port){
struct addrinfo hints, *res;
int sock;
Type: Posts; User: mushy
further info, on annoying bug
This function works and creates the socket ok and connects
int connects(char *server, char *port){
struct addrinfo hints, *res;
int sock;
This function errors on bind, i havent updated my setup in a while is it possible using a ipv6 setup wont work on my computer?
Socket operation on non-socket: Error Bind
int...
lol. You need to get out more if that has annoyed you.
I found this thread, i had forgot about it. I started two similar theads the other day on this same topic as i was off holidaying for a couple of months and am trying to get my head round it again. ...
umm i see now. Makeconnection creates a socket. Can i get it to return the socket or will that not work. I.e int s =makeconnection. Then just have make connection return int sock?
thanks. I started a new thead on it, i got it compiled. I just get frustrated because ive tried to transfer a file in c sockets for ages and can never do it. I even bought a book linux socket...
Packet Recieved -1 Bytes
Bad file descriptor: Error recieving data
then program exits, thats the client side anyway.
Sendfile part sends 107 packets which seems to work to a degree though...
This now compiles but gives errors when i try to transfer the files, i don't know why. I think it might be because im passing the socket to the function and its causing errors. If this is the case i...
wow thanks, what a kind reply. Im sorry i annoyed you with my silly questions. I must learn not to waste such important peoples time. Out of us two its really clear im the dick here.
Hey a while ago i started writing a c program to learn, i wanted to send a file using sockets. I have just come back from a 6 month holiday and am struggling to understand what i was doing. I kind of...
is it still coming across in binary if i wanted to transfer something meaningfull like a picture or a compiled file would this method of transfer work?
ah ok thanks i understand now.
i wrote this and it compiles with no errors or warnings. Works too, but having some small problems.
1) It segfaults at the very end after executing the last printf and calling fclose.
2) It...
cmd: program_name 63 14 18 hello i am a string
int main (int argc, char *argv[]){
int num = atoi(argv[1]);
printf("%d",num);
return 0;
}
im stupid... lol thanks again for your help i appreciate it.
thanks for the info mk.
Hey my other thread the code is quite long, i have simplified it here wondering if you can have a look, its very basic. I cant work out what the problem is though
i...
my whole motivation for c programming is because i want to be able to make handy things like netcat and nmap etc .. im really not trying to be a hacker or anything gay like that. I just find that...
the makeaddress function has an option to make a udp socket, but it doesnt. As you can see i pass the string TCP to the makeaddress function to specify that i want to create a tcp socket which is...
i had a go using what i thought was a good way of doing it, obviously im a noob and im crap - needless to say this isnt working, ive put comments down at the bottom of the code where it seems to be...
i'm struggling with this.
Firstly, is it best to open the file in rb and send it across in binary?
Secondly, what way would i work it do i loop and read chunks for the file at a time and then...
i am guessing but i would assume that because you didnt include
{}
That the while loop is just executing one line i.e the i++ the s=s+3 isnt in the loop and only gets called once the loop has...
yea mk i got the port number working it picks a random port which is what i wanted. Thanks for your help. I kinda understand it a bit better now. I feel like im starting to grasp it. Cheers.
ok guys thanks for your help finally got it work. appreciate it.
Something im confused about though, i didnt realise i had done it and dont understand why it works.
struct sockaddr_in *ad =...
ok i now have this
Im confused about the bind command im getting the same error as you, i pass addr but i declare ad
struct sockaddr_in *ad = (struct sockaddr_in *)addr;
and use ad-> to...
so let me get this right...
if i pass an address to a function
say int name (char *name)
in the function name if i want to change the value of name outside the function i do *name =...