Search Results

Search found 13935 results on 558 pages for 'notify send'.

Page 1/558 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Expiry time in notify-send notifications

    - by gsingh2011
    On my HP computer running Ubuntu 12.04, the brightness and volume increments were much higher than I wanted. On top of that, the notification for the volume was just plain wrong (0% sound did not correspond to 0 on the progress bar). So I decided to override these options with my own commands. I used CompizConfig Settings Manager to add custom commands to the brightness and volume keys (this couldn't be done in the regular settings because these keys were handled by the BIOS, unlike normal function keys). I used xbacklight to control the brightness and amixer to control the volume. The problem is that the nice notify-send notifications don't show up when I manually set the brightness/volume, so now I have to do that myself too. However, there are two problems with notify-send: The expire time option doesn't work You have to wait until a notification is finished before the next one comes up Before I overrided the brightness/volume keys, the system was able to send notifications without these two restrictions. Notifications disappeared within 3 seconds (instead of the default 10), and if I double tapped the volume or brightness button, the progress bar would immediately change to the new brightness (instead of showing the old progress bar for 10 seconds and then showing the new one). Since the system was able to do it, I was wondering how I can achieve the same type of notifications?

    Read the article

  • How to force a new Notification in notify-osd to show up without waiting for the earlier one to exit?

    - by Nirmik
    I have made a script(and a .desktop shortcut leading to this script) for starting and stoping xampp... It checks the status of xampp and accordingly either starts or stops xampp. Now i have assigned a notification as soon as the script is started to display "Starting xampp..." or "Stopping xampp..." and then when xampp is started or stopped,it displays "Xampp started..." or "Xampp stopped..." I've used notify-send to show notification as seen in the script below Now the thing is that here,the second notification waits for the 1st one to disappear and then pops up even if xampp has started/stopped. I want the new notification to appear immediately by forcing the earlier one to exit before the completion of its life-cycle. This can be seen to take plce when you activate/deactivate wireless/networking immediately... For example the "Wireless enabled" comes up on selecting enable wireless and if you immediately select disable wireless,the "Wireless disabled" notification comes up without waiting for "Wireless enabled" notification to complete its life-cycle. So how do i achieve this? #!/bin/sh SERVICE='proftpd' if ps ax | grep -v grep | grep $SERVICE /dev/null then notify-send -i /opt/lampp/htdocs/xampp/img/logo-small.gif "Stopping XAMPP..." && gksudo /opt/lampp/lampp stop && notify-send -i /opt/lampp/htdocs/xampp/img/logo- small.gif "XAMPP Stoped." else notify-send -i /opt/lampp/htdocs/xampp/img/logo-small.gif "Starting XAMPP..." && gksudo /opt/lampp/lampp start && notify-send -i /opt/lampp/htdocs/xampp/img/logo-small.gif "XAMPP Started." fi On the man page for notify-send I found --urgency=LEVEL or -u where levels are low, normal, critical. Is this of any use? making it critical? Also I tried it with the command- notify-send -u=critical"Testing" but that dint work...it gives the error- Unknown urgency criticalTesting specified. Known urgency levels: low, normal, critical. or if I give the command notify-send -u=LOW"Testing" it gives me error missing argument to -u Any relation??

    Read the article

  • Notify-osd notifications appear unthemed in top-left corner (ubuntu 13.10)

    - by Wehlutyk
    Problem I recently upgraded from 13.04 to 13.10, and suddenly notification bubbles don't appear themed as usual in the upper right corner, but they appear as white text on blue background in the upper-left corner. It looks like this: Unsuccesful attempts to fix it I tried reinstalling unity, notify-osd, ubuntu-desktop removed notification-daemon which was installed, none of that fixes it. In fact running ps aux | grep notify-osd shows that notify-osd isn't even running. But when I try to start it manually by running /usr/lib/x86_64-linux-gnu/notify-osd I get: ** (notify-osd:4618): WARNING **: Another instance has already registered org.freedesktop.Notifications ** (notify-osd:4618): WARNING **: Could not register instance If I understand well, the instance is registered by the /usr/share/dbus-1/services/org.freedesktop.Notifications.service file, which right now contains: [D-BUS Service] Name=org.freedesktop.Notifications Exec=/usr/lib/x86_64-linux-gnu/notify-osd Renaming or deleting that file (and rebooting) has no effect whatsoever (and it is not recreated automatically). This is not a duplicate of No notifications from notify-osd on 13.10 (and by the way I purged gnome-flashback-session along with notification-daemon) Question(s) How can I debug this? How can I get notifications to come back to normal? If additional debug information is needed, I'll be happy to add it (just that I can't find any more).

    Read the article

  • notify-send ignores timeout?

    - by Hooked
    Maybe I'm doing something wrong, but shouldn't the commands (run separately) notify-send -t 1 "test" notify-send -t 1000 "test" notify-send -t 10000 "test" Have different timeouts? The first being nearly instantaneous, the second one taking 1 sec and the third 100 seconds. In all cases it seems to take about six seconds. I'm using the development branch of Precise, if this isn't an issue in the released version I'll close this as being too localized, but I'm unable to test it now.

    Read the article

  • lubuntu notify-send remove limit of 21?

    - by giuspen
    sending notifications with notify-send in lubuntu notify-send -i error -t 1000 "Error" "error notification" I can send only 21 of them, after that no more notifications sent, the only way to receive more notifications is to click on the panel where there's a letter with the number 21 and then click on the button "clear all notifications". Is there a way to avoid the need to go clicking the button, also is there a way to remove at all that letter with number of notifications received? UPDATE: I realize that notification-daemon (0.7.3) is used. I downloaded the sources and edited the source code (nd-queue.c - on_bubble_destroyed) to do not buffer but always destroy the bubbles but I would prefer another way...

    Read the article

  • Schedule Auto Send & Receive in Microsoft Outlook

    - by Mysticgeek
    If you use Outlook as your email client, you might want to schedule how often it checks for new messages. Today we show you how to schedule how often auto send/receive occurs. If you’re busy during the day and need to keep up with your emails, you might want want Outlook to check for new messages every few minutes. Here we’ll show how to schedule it in Office 2010, 2007, and 2003 for a busy inbox where you want to keep on top of your important emails. Outlook 2010 To schedule Auto Send/Receive in Outlook 2010, click on the File tab then Options. The Outlook Options window opens…click on Advanced and scroll down to Send and receive and click on the Send/Receive button. In the Send/Receive Groups window under Setting for group “All Accounts” check the box Schedule an automatic send/receive every…minutes. It is set to 30 minutes by default and you can change the minutes to whatever you want it to be. If you’re busy and want to keep up with your messages you can go as low as every one minute. You can also get to the Send/Receive groups by selecting Send/Receive tab on the Ribbon and then Define Send/Receive Groups. Outlook 2007 To select the send/receive time intervals in Outlook 2007, open Outlook and click on Tools \ Options. Click on the Mail Setup tab, check the box next to Send immediately when connected then the Send/Receive button.   Now change the schedule to automatically send/receive. You can also access the Send/Receive Groups section by going to Send/Receive > Send/Receive Settings and Define Send/Receive Groups. Outlook 2003 In Outlook 2003 click on Tool \ Options… Click on the Mail Setup tab then check Send immediately when connected, then the Send/receive button. Then set the amount of time between send/receive attempts. If you live out of Microsoft Outlook and want to keep up with messages, setting the automatic send/receive minutes will keep you up to date. Similar Articles Productive Geek Tips Force Outlook 2007 to Download Complete IMAP ItemsUse Hotmail from Microsoft OutlookClear the Auto-Complete Email Address Cache in OutlookIntegrate Twitter With Microsoft OutlookCreate an Email Template in Outlook 2003 TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips CloudBerry Online Backup 1.5 for Windows Home Server Snagit 10 VMware Workstation 7 Acronis Online Backup Windows Firewall with Advanced Security – How To Guides Sculptris 1.0, 3D Drawing app AceStock, a Tiny Desktop Quote Monitor Gmail Button Addon (Firefox) Hyperwords addon (Firefox) Backup Outlook 2010

    Read the article

  • How to Create a Send/Receive Group for RSS Feeds in Outlook 2013

    - by Lori Kaufman
    If you choose to manually update your RSS feeds on demand, there is a way to do this without having to send and receive your email at the same time. You can create a special Send/Receive Group for your RSS feeds. NOTE: If you choose to not have your RSS feeds updated automatically, creating a separate Send/Receive Group for your RSS feeds is useful so you can update them when you want to. To begin creating a new Send/Receive Group, click the File tab. Click Options in the menu on the left side of the Account Information screen. On the Outlook Options dialog box, click Advanced in the left pane list of menu options. In the right pane, scroll down to the Send and receive section and click the Send/Receive button. On the Send/Receive Groups dialog box, click New next to the list of groups. On the Send/Receive Group Name dialog box, enter a name, such as “RSS Feeds On Demand Only,” in the edit box and click OK. For all the other Accounts, except RSS, in the list on the left, de-select the Include RSS Feeds in this Send/Receive group check box so there is NO check mark in the box. Click RSS under Accounts, and make sure the Include RSS Feeds in this Send/Receive group check box is selected. NOTE: If you want to have a separate Send/Receive group for each RSS Feed or group certain RSS feeds together, you can turn on and off specific feeds in the lower half of the Send/Receive Settings dialog box. If you decide to do this, you might specify a more appropriate name for each Send/Receive group for the RSS feeds. Click OK to accept your changes and close the Send/Receive dialog box. Make sure your new Send/Receive group is selected in the list of groups on the Send/Receive Groups dialog box. De-select all the options under Setting for group section at the bottom of the dialog box and click Close. This prevents this group from being updated when you click the general Send/Receive button to retrieve your email. Click OK on the Outlook Options dialog box. To manually update your RSS feeds, click the Send / Receive tab. Click Send/Receive Groups and select your new group from the drop-down list. You can change, rename, or remove any Send/Receive Groups you create by accessing the Send/Receive Groups dialog box again.     

    Read the article

  • Excel - "send to Mail recipient" creates 2nd copy of EMail in Inbox

    - by ssollinger
    When sending Excel sheets using the menu item "File" - "Sent To" - "Mail recipient (as attachment)" I get additional copies of the email in the Inbox. When I press "send" then I get 2 copies of the email in Outlook - as expected one in the Outbox (which moves into the Sent folder as soon it is sent off) and an additional one in the Inbox. How do I stop the copy message appearing in the Inbox? System: Excel 2000, Outlook 2000, Windows XP. Antivirus is AVG Free 2011. I know this is a very old system, but it is not my PC and there isn't any chance to get it replaced in the near future yet. SOme further details: The copy in the inbox appears at the same time as the normal copy goes into the Outbox (i.e. as soon I press send). It doesn't contain anything in the From field (i.e. there is no sender, just the recipient of the mail). It has a different icon in Outlook to the other emails - the icon is the one for "saved or unsent message". I tried it with a few different spreadsheets and it happens with all of them. It happens with every recipient, and it only happens if sending from within Excel (i.e. using the Send to menu item). I can delete the attachment before sending and it will still create a copy. If I create a new message in Outlook and then add the Excel document as attachment then I don't get the copy of the message in the inbox, it only happens when using the send to item in Excel. It only started doing this recently. Around that time the Antivirus (AVG Free) was upgraded to the latest version (from the previous version - 2010? - to version 2011), but this might not be related. I thought I know Excel really well but have never seen this happening before, and I can't find any setting in Excel or Outlook that is causing this. Any ideas?

    Read the article

  • The behavior of send() and recv() in socket communication

    - by gc
    The following is the setup: Server Client | | accept connect | | v | send msg1- | | | v v recv <- send | | v v send msg2- recv | | v v close Here is my question: 1. Client actually receives msg1 before it closes, why is it like this? 2. send msg2 returns normally. Since client closes after receiving msg1, why is send msg2 successful?

    Read the article

  • Problem in using a second call to send() in C

    - by Paulo Victor
    Hello. Right now I'm working in a simple Server that receives from client a code referring to a certain operation. The server receives this data and send back the signal that it's waiting for the proper data. /*Server Side*/ if (codigoOperacao == 0) { printf("A escolha foi 0\n"); int bytesSent = SOCKET_ERROR; char sendBuff[1080] = "0"; /*Here "send" returns an error msgm while trying to send back the signal*/ bytesSent = send(socketEscuta, sendBuff, 1080, 0); if (bytesSent == SOCKET_ERROR) { printf("Erro ao enviar"); return 0; } else { printf("Bytes enviados : %d\n", bytesSent); char structDesmontada[1080] = ""; bytesRecv = recebeMensagem(socketEscuta, structDesmontada); printf("structDesmontada : %s", structDesmontada); } } Following here is the client code responsible for sending the operation code and receiving the signal char sendMsg[1080] = "0"; char recvMsg[1080] = ""; bytesSent = send(socketCliente, sendMsg, sizeof(sendMsg), 0); printf("Enviei o codigo (%d)\n", bytesSent); /*Here the program blocks in a infinite loop since the server never send anything*/ while (bytesRecv == SOCKET_ERROR) { bytesRecv = recv(socketCliente, recvMsg, 1080, 0); if (bytesRecv > 0) { printf("Recebeu\n"); } Why this is happening only in the second attempt to send some data? Because the first call to send() works fine. Hope someone can help!! Thnks

    Read the article

  • WPF Notify changes on object

    - by Erik Z
    I have a gridview were I define some columns, like this... <GridViewColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding MyProp}" /> </DataTemplate> </GridViewColumn.CellTemplate> I bind my gridview to a collection and implemts INotifyPropertyChanged in the property MyProp. This works well and any changes of MyProp are reflected to the gridview. If I add another column that is bound to the object itself I dont get any notifications/updates. My code... <GridViewColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding Converter={StaticResource myConverter}}"/> </DataTemplate> </GridViewColumn.CellTemplate> I think I need something like INotifyPropertyChanged for the object but I have no idea how to do this. Any suggestions?

    Read the article

  • WPF custom DependencyProperty notify changes

    - by morsanu
    Hey guys I have a class called MyComponent and it has a DependencyProperty caled BackgroundProperty. public class MyComponent { public MyBackground Background { get { return (MyBackground)GetValue(BackgroundProperty); } set { SetValue(BackgroundProperty, value); } } public static readonly DependencyProperty BackgroundProperty = DependencyProperty.Register("Background", typeof(MyBackground), typeof(MyComponent), new FrameworkPropertyMetadata(default(MyBackground), new PropertyChangedCallback(OnPropertyChanged))); } MyBackground is a class that derives from DependencyObject and it has some DependencyProperties. public class MyBackground : DependencyObject { public Color BaseColor { set { SetValue(BaseColorProperty, value); } get { return (Color)GetValue(BaseColorProperty); } } public static readonly DependencyProperty BaseColorProperty = DependencyProperty.Register("BaseColor", typeof(Color), typeof(MyBackground ), new UIPropertyMetadata(Colors.White)); [...] } Now, what I want is when a property from MyBackground is changed, MyComponent to be notified that MyBackground has changed and the PropertyChangedCallback named OnPropertyChanged to be called.

    Read the article

  • notify url is not called

    - by Jahangeer Ahmed
    Dim redirecturl As String = "" redirecturl = ConfigurationManager.AppSettings("papalUrl").ToString() & "us/cgi-bin/webscr?cmd=_cart&upload=1&business=" & ConfigurationManager.AppSettings("paypalemail").ToString() Dim j As Integer = 0 Dim dr1 As DataRow If ds.Tables("ReviewOrder").Rows.Count 0 Then Dim requestsFile As String = Server.MapPath("~/App_Data/PaymentRequests.xml") ' ds.Tables("ReviewOrder").WriteXml(requestsFile) For j = 0 To ds.Tables("ReviewOrder").Rows.Count - 1 dr1 = ds.Tables("ReviewOrder").Rows(j) redirecturl += "&item_name_" & j + 1 & "=" & dr1("varTitle") redirecturl += "&amount_" & j + 1 & "=" & dr1("flRate") redirecturl += "&image_url_" & j + 1 & "=" & ConfigurationManager.AppSettings("RSSurl").ToString() & dr1("imgImage") redirecturl += "&quantity_" & j + 1 & "=" & Convert.ToInt64(dr1("flQuantity")) ''redirecturl += "&item_name_2=Sample_testing2&amount_2=9.50" ''redirecturl += "&quantity_2=2" ''redirecturl += "&item_name_3=Sample_testing3" ''redirecturl += "&amount_3=8.50" ''redirecturl += "&quantity_3=3" redirecturl += "&custom_" & j + 1 & "=" & dr1("BasketID") Next End If redirecturl += "&currency=" & ConfigurationManager.AppSettings("CurrencyCode").ToString() redirecturl += "&first_name=" & firstName redirecturl += "&last_name=" & lastName redirecturl += "&city=" & city redirecturl += "&state=" & state redirecturl += "&zip=" & zip redirecturl += "&address1=" & address1 redirecturl += "&address2=" & address2 redirecturl += "&notify_url=" & Server.UrlEncode(ConfigurationManager.AppSettings("NotifyUrl").ToString() & "&rm=2") redirecturl += "&return=" & ConfigurationManager.AppSettings("SuccessURL").ToString() 'Failed return page url redirecturl += "&cancel_return=" & ConfigurationManager.AppSettings("FailedURL").ToString() Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "Redirect", "window.parent.location='" & redirecturl & "';", True)

    Read the article

  • Send mail via gmail with PowerShell V2's Send-MailMessage

    - by Scott Weinstein
    I'm trying to figure out how to use PowerShell V2's Send-MailMessage with gmail. Here's what I have so far. $ss = new-object Security.SecureString foreach ($ch in "password".ToCharArray()) { $ss.AppendChar($ch) } $cred = new-object Management.Automation.PSCredential "[email protected]", $ss Send-MailMessage -SmtpServer smtp.gmail.com -UseSsl -Credential $cred -Body... I get the following error Send-MailMessage : The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at At foo.ps1:18 char:21 + Send-MailMessage <<<< ` + CategoryInfo : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-MailMessage], SmtpException + FullyQualifiedErrorId : SmtpException,Microsoft.PowerShell.Commands.SendMailMessage Am I doing something wrong, or is Send-MailMessage not fully baked yet (I'm on CTP 3)? Edit - two additional restrictions I want this to be non-interactive, so get-credential won't work The user account isn't on the gmail domain, but an google apps registered domain

    Read the article

  • how to continuously send data without blocking?

    - by Donal Rafferty
    I am trying to send rtp audio data from my Android application. I currently can send 1 RTP packet with the code below and I also have another class that extends Thread that listens to and receives RTP packets. My question is how do I continuously send my updated buffer through the packet payload without blocking the receiving thread? public void run() { isRecording = true; android.os.Process.setThreadPriority (android.os.Process.THREAD_PRIORITY_URGENT_AUDIO); int buffersize = AudioRecord.getMinBufferSize(8000, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT); Log.d("BUFFERSIZE","Buffer size = " + buffersize); arec = new AudioRecord(MediaRecorder.AudioSource.MIC, 8000, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, buffersize); short[] readBuffer = new short[80]; byte[] buffer = new byte[160]; arec.startRecording(); while(arec.getRecordingState() == AudioRecord.RECORDSTATE_RECORDING){ int frames = arec.read(readBuffer, 0, 80); @SuppressWarnings("unused") int lenghtInBytes = codec.encode(readBuffer, 0, buffer, frames); RtpPacket rtpPacket = new RtpPacket(); rtpPacket.setV(2); rtpPacket.setX(0); rtpPacket.setM(0); rtpPacket.setPT(0); rtpPacket.setSSRC(123342345); rtpPacket.setPayload(buffer, 160); try { rtpSession2.sendRtpPacket(rtpPacket); } catch (UnknownHostException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (RtpException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } So when I send on one device and receive on another I get decent audio, but when I send and receive on both I get broken sound like its taking turns to send and receive audio. I have a feeling it could be to do with the while loop? it could be looping around in there and not letting anything else run?

    Read the article

  • Configure Thunderbird to never send (or even try to send) HTML emails

    - by Brent.Longborough
    Where can I set it to tell Thunderbird to always send as plain-text emails and never as HTML formatted messages? I hate HTML-based email, and always do everything possible to send my emails as plain text. Thunderbird is always pestering me with questions like "This recipient cannot receive HTML..." or "In order to sign this email, it needs to be converted to plain text..." Is there a way I can simply say to Thunderbird "Look, old chap, it's all plain text, so don't bother me any more, ever, again"?

    Read the article

  • In which object should I implement wait()/notify()?

    - by Christopher Francisco
    I'm working in an Android project with multithreading. Basically I have to wait to the server to respond before sending more data. The data sending task is delimited by the flag boolean hasServerResponded so the Thread will loop infinitely without doing anything until the flag becomes true. Since this boolean isn't declared as volatile (yet), and also looping without doing anything wastes resources, I thought maybe I should use AtomicBoolean and also implement wait() / notify() mechanism. Should I use the AtomicBoolean object notify() and wait() methods or should I create a lock Object?

    Read the article

  • Hide the built-in Send button in Outlook 2003

    - by Raheem
    I am using ms-outlook 2003, i want to hide the built-in send button and use the custom button to send the mail. As i have worked on C,C++ and on Java, dont know how to work on VB/VBScript/VBA, can any body tell me how to hide this button and also how to send mail from custom button, how to access the fields of mail (ie., the TO field, Subject field, Msg Body, attachment etc).

    Read the article

  • send c++ structure to msmq message

    - by Gobalakrishnan
    C++ Code: typedef struct { char cfiller[7]; short MsgCode; char cfiller1[11]; short MsgLength; char cfiller2[2]; }Message ; I want to send the above structure as a msmq message I am able to send string to msmq but it is giving error to send the above structure. thank you

    Read the article

  • C socket programming: client send() but server select() doesn't see it

    - by Fantastic Fourier
    Hey all, I have a server and a client running on two different machines where the client send()s but the server doesn't seem to receive the message. The server employs select() to monitor sockets for any incoming connections/messages. I can see that when the server accepts a new connection, it updates the fd_set array but always returns 0 despite the client send() messages. The connection is TCP and the machines are separated by like one router so dropping packets are highly unlikely. I have a feeling that it's not select() but perhaps send()/sendto() from client that may be the problem but I'm not sure how to go about localizing the problem area. while(1) { readset = info->read_set; ready = select(info->max_fd+1, &readset, NULL, NULL, &timeout); } above is the server side code where the server has a thread that runs select() indefinitely. rv = connect(sockfd, (struct sockaddr *) &server_address, sizeof(server_address)); printf("rv = %i\n", rv); if (rv < 0) { printf("MAIN: ERROR connect() %i: %s\n", errno, strerror(errno)); exit(1); } else printf("connected\n"); sleep(3); char * somemsg = "is this working yet?\0"; rv = send(sockfd, somemsg, sizeof(somemsg), NULL); if (rv < 0) printf("MAIN: ERROR send() %i: %s\n", errno, strerror(errno)); printf("MAIN: rv is %i\n", rv); rv = sendto(sockfd, somemsg, sizeof(somemsg), NULL, &server_address, sizeof(server_address)); if (rv < 0) printf("MAIN: ERROR sendto() %i: %s\n", errno, strerror(errno)); printf("MAIN: rv is %i\n", rv); and this is the client side where it connects and sends messages and returns connected MAIN: rv is 4 MAIN: rv is 4 any comments or insightful insights are appreciated.

    Read the article

  • Why is it assumed that send may return with less than requested data transmitted on a blocking socke

    - by Ernelli
    The standard method to send data on a stream socket has always been to call send with a chunk of data to write, check the return value to see if all data was sent and then keep calling send again until the whole message has been accepted. For example this is a simple example of a common scheme: int send_all(int sock, unsigned char *buffer, int len) { int nsent; while(len 0) { nsent = send(sock, buffer, len, 0); if(nsent == -1) // error return -1; buffer += nsent; len -= nsent; } return 0; // ok, all data sent } Even the BSD manpage mentions that ...If no messages space is available at the socket to hold the message to be transmitted, then send() normally blocks... Which indicates that we should assume that send may return without sending all data. Now I find this rather broken but even W. Richard Stevens assumes this in his standard reference book about network programming, not in the beginning chapters, but the more advanced examples uses his own writen (write all data) function instead of calling write. Now I consider this still to be more or less broken, since if send is not able to transmit all data or accept the data in the underlying buffer and the socket is blocking, then send should block and return when the whole send request has been accepted. I mean, in the code example above, what will happen if send returns with less data sent is that it will be called right again with a new request. What has changed since last call? At max a few hundred CPU cycles have passed so the buffer is still full. If send now accepts the data why could'nt it accept it before? Otherwise we will end upp with an inefficient loop where we are trying to send data on a socket that cannot accept data and keep trying, or else? So it seems like the workaround, if needed, results in heavily inefficient code and in those circumstances blocking sockets should be avoided at all an non blocking sockets together with select should be used instead.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >