Questions tagged [send]

is a generic tag for communication between programmed elements using some protocol.

This is the generic tag to use when two or more elements communicate each other using some protocol. An example of this is, send a data flow through sockets from one application to another, send a data flow from a client to a server or send some data from one application architecture component to another.

2171 questions
21
votes
6 answers

With C TCP sockets, can 'send' return zero?

Is it ever possible for the C send function to return zero when using TCP sockets? The man page just says that it will return the number of bytes sent, but I am not sure if it will just return -1 when it can't send any data.
Adrian
  • 14,931
  • 9
  • 45
  • 70
21
votes
3 answers

C, sendfile() and send() difference?

sendfile() copies data between two file descripters within kernel space. Somewhere I saw if you are writing a web server in C in linux you should use send() and recv() instead of using write() and read(). So is the send() use the kernel space as…
samsamara
  • 4,630
  • 7
  • 36
  • 66
20
votes
5 answers

Discord.js sending a message to a specific channel

I'm failing to achieve something very simple. I can't send a message to a specific channel. I've browsed trough the documentation and similar threads on stack overflow. client.channels.get().send() does NOT work. It is not a function. I also do…
Danislav Kamenov
  • 213
  • 1
  • 2
  • 5
20
votes
6 answers

How to send value attribute from radio button in PHP

I am struggling with sending the value of a radiobutton to an email. I have coded 2 radiobuttons, where I have set the first on to be default checked. The form and values work, however the radio button value is not submitted. Any wise words?
René Hansen
  • 231
  • 2
  • 3
  • 6
19
votes
3 answers

SFTP to send file with bash script

I'm using key authentication, so password is not an issue. I have a file whose name I know and I simply want to send it to another machine over sftp. I tried searching but couldn't find this (seemingly simple) question anywhere. Perhaps my…
Bing
  • 3,071
  • 6
  • 42
  • 81
17
votes
4 answers

Linux Socket: How to detect disconnected network in a client program?

I am debugging a c based linux socket program. As all the examples available in websites, I applied the following structure: sockfd= socket(AF_INET, SOCK_STREAM, 0); connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)); send_bytes =…
user2052197
  • 225
  • 1
  • 3
  • 6
17
votes
3 answers

Android, How to send HTML email and force Android to send it through G-Mail not other applications?

I want to send email through my application. I need to send HTML based email just through G-Mail. I found following solutions that each of them has pros and cons. 1) Using Intent (Intent.ACTION_SEND). This is very simple way and I can see my body in…
Hesam
  • 52,260
  • 74
  • 224
  • 365
16
votes
2 answers

C# send image over HTTP

I have a small HTTP-Server here written in C# and until now I only needed to send raw text back to the sender. But now I have to send a JPG-Image and I dont unterstand how. this is what I have now: // Read the HTTP Request Byte[] bReceive = new…
martinyyyy
  • 1,652
  • 3
  • 21
  • 44
15
votes
2 answers

Get the list of apps capable of handling the SEND intent to display in a View (not a popup dialog)

I'm trying to get the list of all apps installed on a phone capable of handling the SEND intent. I am currently handling this situation by using Intent.createChooser but this is not what I am trying to achieve as I would like to be able to get…
Pierre
  • 153
  • 1
  • 4
15
votes
3 answers

How sendmsg works?

As you know sendmsg has this declaration: int sendmsg(int s, const struct msghdr *msg, int flags); and msghdr structure has this form: struct msghdr { void * msg_name; /* optional address */ socklen_t msg_namelen; /* size…
whoi
  • 3,281
  • 7
  • 36
  • 44
15
votes
3 answers

C socket: recv and send all data

I would like to obtain a behavior similar to this: Server run Client run Client type a command like "help" or other Server responds appropriately go to 3 The problem is that when my function excCommand("help") run just a little text is received…
Lorenzo Cinque
  • 954
  • 1
  • 14
  • 22
14
votes
5 answers

What is the point of using "send" instead of a normal method call?

as far as I understand 'send' method, this some_object.some_method("im an argument") is same as this some_object.send :some_method, "im an argument" So what is the point using 'send' method?
Leo
  • 2,061
  • 4
  • 30
  • 58
14
votes
2 answers

How to render XML template and then use SEND_DATA in Ruby on Rails 3.2.8?

Can anybodyes help me with XML template rendering and send_data? I have a controller: def show @calculation = Calculation.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @calculation } …
Dmitry
  • 147
  • 1
  • 6
14
votes
1 answer

how to send my game made with pygame to others?

I'm new to making games with pygame and my first attempt is still a work in progress, but I was wondering how to publish or send my game to my friends who don't have pygame so that they can play it. I looked online but haven't found anything useful.
maxwellicus
  • 143
  • 2
  • 6
13
votes
4 answers

Equivalent of ruby obj.send in python

In ruby if I have an object obj, with a method called funcname, I can call the method using the following syntax obj.send(funcname) Is there something similar in python. The reason I want to do this, that I have a switch statement where I set the…
Puneet Paul
  • 131
  • 1
  • 3