由买买提看人间百态

topics

全部话题 - 话题: recv
1 2 下页 末页 (共2页)
z***m
发帖数: 1602
1
来自主题: JobHunting版 - 问道FB的题
Given 2 functions String recv() and String ReadLine()
recv() generates some string (Example:"123n45n6789").
ReadLine() should read the string being returned by recv() and print all
characters until the first n.
After that it should read the recv() string again and print the next
characters until the 2nd n.
Example: recv(): "123n45n6789"
ReadLine(): "123" //first call of ReadLine
ReadLine(): "45" // second call of ReadLine
However, the next sequence now doesn't have ... 阅读全帖
a*****s
发帖数: 2663
2
来自主题: Linux版 - 关于samba/cifs的速度
network itself seems to be ok, 685.56Mb/sec, however it eats up 52.45% the 1.6GHz CPU!
$ /opt/csw/bin/netperf -H ubuntu.local -t TCP_STREAM -c -C -- -S 1048576
TCP STREAM TEST from ::ffff:0.0.0.0 (0.0.0.0) port 0 AF_INET to ::ffff:192.
168.0.124 (192.168.0.124) port 0 AF_INET
Recv Send Send Utilization Service
Demand
Socket Socket Message Elapsed Send Recv Send Recv
Size Size Size Time Throughput local remote loc
w***s
发帖数: 21
3

It seems that you know nothing about socket programming.
ok, normally your program will block on command 'recv' or 'recvfrom'
so, to question 1, when the client close the connection. the recv will return
0.to question 2, when data is available on socket, recv will return with the
data length and the content of the data just received.
d*s
发帖数: 699
4
来自主题: JobHunting版 - 问一道之前版上M家面经的题
import mpi4py as MPI
size = MPI.COMM_WORLD.size; rank = MPI.COMM_WORLD.rank
datalist = [0 for ii in xrange(size)]
datalist[rank] = data;
stat = MPI.status()
non-block情况:
for id in xrange(size):
if id==rank: continue
MPI.Isend(data, dest=id)
ii=0
while ii if MPI.Iprobe(source=MPI.ANY_SOURCE, status=stat):
tmp = MPI.Irecv(source=stat.source)
datalist[stat.source] = tmp
ii+=1
block情况麻烦一些,只想出按顺序发送接收的笨办法:
for id in xrange(rank-1):
datalist[id] = MPI.Recv(tag=id)
for id in ... 阅读全帖
w****f
发帖数: 1420
5
来自主题: Hardware版 - 请问NAS应该怎么备份?
http://docs.oracle.com/cd/E18752_01/html/819-5461/gbchx.html#gb
You can use the zfs send command to send a copy of a snapshot stream and
receive the snapshot stream in another pool on the same system or in another
pool on a different system that is used to store backup data. For example,
to send the snapshot stream on a different pool to the same system, use
syntax similar to the following:
# zfs send tank/data@snap1 | zfs recv spool/ds01
If you are sending the snapshot stream to a different sys... 阅读全帖
h**o
发帖数: 548
6
来自主题: Programming版 - 关于network connection 出错
我改写了一段程序,里面考虑了几种socket 建立连接时的出错情况。我现在要测试我
对这几种情况的处理对不对:
1。连接建立后用send 送数据 给对方, 返回 负值. i.e. ret = send(...);ret <0;
2. 连接建立后从对方recv 收数据 , 返回 负值. i.e. ret = recv(...);ret <0;
3. 连接建立后用send 送数据 给对方, 没回音.
请问怎样模拟这些错误?
p***o
发帖数: 1252
7
来自主题: Programming版 - 研讨一下TCP fragment的问题
Any book on networking/socket programming would mention in the very
beginning that TCP is stream socket. In other words, you get a stream
of bytes, no more and no less. A send() is not guaranteed to send all
the bytes you attempt to write and a recv() is not guaranteed to receive
all the bytes you attempt to read. So you could send 100 bytes at one
end and recv() would return twice, 50 bytes each, at the other end.
For reference, check Unix Network Programming, Volume 1.
t****t
发帖数: 6806
8
来自主题: Programming版 - 研讨一下TCP fragment的问题
just as pp2 said, send() is not guaranteed to send full request and recv()
is not guaranteed to receive full request. always check the return value and
assemble the request/result appropriately , you should be fine.

application layer to establish the correct send/recv operations. that is why
I raised this question here. It is good to have some examples, e.g. net ant
, bit torrent. But I don't want to read those big projects. May sb got some
short concise code example.
d*******r
发帖数: 3299
9
来自主题: Programming版 - 各位所在公司的code review烦人不?
我们传的 1024 左右 bytes 的 message,也不小了,
我住过的美国 Apartments, 设置 Xbox 测试 MTU/MSS 的结果一般是 1500/1460 bytes,
比 1024稍大。但是如果你Google MSS, 也有说不少是 500 bytes 左右的 MSS.
对于传给 TCP socket 的 message,只要 TCP 自己做了分包分出了更小的 TCP
segments,
然后这些 segments 在中间网络经历的延迟不一样,
socket receiver 方一个 recv() call 就容易收不到完整 message.
当然还有其他原因,也会导致receiver方一个 recv() call 收不到完整 message.
s********k
发帖数: 6180
10
看了下你的逻辑,你现在这样实现?
go func(recv socket)?
如果成这样是不是更好?
func recv(socket){
for pub in range publishers{
go func(service)
}
}
就是说把goroutine用在业务逻辑,不是IO上?

epoll
IO
go
M*****8
发帖数: 17722
11
2013年7月9日最新的1688个看跌的股票。
多数到顶。墙街已深入插管,吸血在即。
排列依次为,号码,股票符号,收市价。
#0001, A , 44.6000
#0002, AA , 7.9010
#0003, AAGIY , 17.1600
#0004, AAMRQ , 4.7300
#0005, AAN , 28.9700
#0006, AAON , 24.7400
#0007, AAP , 83.2000
#0008, AAUKY , 9.5300
#0009, ABAX , 50.2800
#0010, ABCP , 1.0000
#0011, ABT , 34.7400
#0012, ACAT , 51.5000
#0013, ACE , 92.3800
#0014, ACGL , 52.3700
#0015, ACH , ... 阅读全帖
M*****8
发帖数: 17722
12
2013年7月9日最新的1688个看跌的股票。
多数到顶。墙街已深入插管,吸血在即。
排列依次为,号码,股票符号,收市价。
#0001, A , 44.6000
#0002, AA , 7.9010
#0003, AAGIY , 17.1600
#0004, AAMRQ , 4.7300
#0005, AAN , 28.9700
#0006, AAON , 24.7400
#0007, AAP , 83.2000
#0008, AAUKY , 9.5300
#0009, ABAX , 50.2800
#0010, ABCP , 1.0000
#0011, ABT , 34.7400
#0012, ACAT , 51.5000
#0013, ACE , 92.3800
#0014, ACGL , 52.3700
#0015, ACH , ... 阅读全帖
l*******g
发帖数: 27064
13
来自主题: Automobile版 - gofan在么
吉利的破网站怎么回事,根本打不开
http://mall.geely.com/index.php/network
看了下,加载一大堆烂玩意
总是卡在其中之一不动了
mall.geely.com
api.map.baidu.com
c.cnzz.com
cdnmaster.com
cnzz.mmstat.com
icon.cnzz.com
idinfo.zjaic.gov.cn
recv-wd.gridsumdissector.com
s95.cnzz.com
smt.admaster.comc.n
static.gridsumdissector.com
www.webdissector.com
a**********t
发帖数: 4263
14
来自主题: ebiz版 - recv shopoper check
Amount: $5.41
p***a
发帖数: 6396
15
来自主题: ebiz版 - recv shopoper check
baozi
D***0
发帖数: 4043
16
来自主题: ebiz版 - recv shopoper check
me too,32刀,太瘦了
g*****i
发帖数: 9630
17
来自主题: ebiz版 - recv shopoper check
pai
A*T
发帖数: 4820
18
来自主题: ebiz版 - recv shopoper check
哪个月的?
d*********r
发帖数: 11979
19
来自主题: ebiz版 - recv shopoper check
偶两月前被关的账户给了 278.xx shopper真好
L******1
发帖数: 8133
20
来自主题: ebiz版 - recv shopoper check
t*****e
发帖数: 3276
21
来自主题: ebiz版 - recv shopoper check
我也是一般被关的账户都比较肥
g*******y
发帖数: 1930
22
来自主题: JobHunting版 - OPT Case report
for me it took 2 biz days(friday notice, recv card next monday) since CSC is
near to my home

rejection
r**u
发帖数: 1567
23
6. 嵌入式系统调试中硬断点和软断点的区别。
软断点可以被硬断点interrupt
硬断点不能被任何interrupt
7. socket通信中接收方如何判断数据已经传送完。
如果是传文件,会receive EOF,num of bytes recv = 0
Please correct me.
g**u
发帖数: 583
24
来自主题: JobHunting版 - Amazon on site面试, 攒RP, 求祝福
今天刚面的Amazon,求祝福
面的题目如下:面的是5个人,第一个是HR, 就聊了些大概的问题,关于Amazon,有关
面试安排, 面试的语言和他们的工作流程之类,略无不表。后面面了4个engineer,把
记住的题目说一下。
每轮面试45 minutes, Interviewer will come to the office.
有个的题目是:如何找到bst中第二大的数;可以用in order visit,然后返回倒数第二
个,但是时间和空间都是O(n);要求improve,一个方案是寻找最大值(right most
nodes),然后寻找bst中最后一个小于该node的节点(log n),要求code实现第二个方法
;然后是要在hash table中实现一个function可以按照插入的顺序打印出来;接着是实
现linux下面的count words,用了2个whileloop分别处理当前指针在word中和word间的
空格,要求2种情况一起处理,写了一半没写完(缺少练习啊)
有一个题目是关于C++和Java中的内存分配的;然后问了关于3-tier(UI, middle-tier
... 阅读全帖
g*****i
发帖数: 2162
25
来自主题: JobHunting版 - guangyi的面经和总结
**********************************
M:
phone interview (1 round):
why MS?
biggest challenge
why like coding and algorithm?
what is good code?
your longest code
biggest accomplishment
if you don't want some functions to be modified in java, what to do?
does java allow multiple inheritance?
what does synchronized keyword mean in java?
CEO wants a book, you find it in the system of a nearby bookshop. You went
to the bookshop but fail to find, you have 5 minutes, what will you do?
you have to test 10... 阅读全帖
g*****i
发帖数: 2162
26
来自主题: JobHunting版 - guangyi的面经和总结
**********************************
M:
phone interview (1 round):
why MS?
biggest challenge
why like coding and algorithm?
what is good code?
your longest code
biggest accomplishment
if you don't want some functions to be modified in java, what to do?
does java allow multiple inheritance?
what does synchronized keyword mean in java?
CEO wants a book, you find it in the system of a nearby bookshop. You went
to the bookshop but fail to find, you have 5 minutes, what will you do?
you have to test 10... 阅读全帖
w****x
发帖数: 2483
27
来自主题: JobHunting版 - G電面 大家參詳一下怎麼個狀況
第二题是不是作stream line, 就是维护一个queue, 一个recv buffer, 一个send
buffer, queue加锁,
G******i
发帖数: 5226
28
来自主题: JobHunting版 - [合集] guangyi的面经和总结
☆─────────────────────────────────────☆
guangyi ( 光一) 于 (Sat Oct 29 00:10:37 2011, 美东) 提到:
**********************************
M:
phone interview (1 round):
why MS?
biggest challenge
why like coding and algorithm?
what is good code?
your longest code
biggest accomplishment
if you don't want some functions to be modified in java, what to do?
does java allow multiple inheritance?
what does synchronized keyword mean in java?
CEO wants a book, you find it in the system of a nearby bookshop. You ... 阅读全帖
j********x
发帖数: 2330
29
来自主题: JobHunting版 - 面经
PS1: 1. Merge sorted linked lists; 2. Iterative inorder traversal of
binary tree
PS2: 1. Inorder successor of binary search tree;
onsite: 1. infix expression evaluation of integers and + - * /; 2.
implement a system to route packets based on their priority; implement
associative container Map; 3. Given n nodes, each node has 2 blocking
functions: send(int to_id, int msg); recv(int from_id); each node has a
value; design a method to distribute the sum of all values on every node to
all nodes; 4. ... 阅读全帖
j********x
发帖数: 2330
30
来自主题: JobHunting版 - 面经
PS1: 1. Merge sorted linked lists; 2. Iterative inorder traversal of
binary tree
PS2: 1. Inorder successor of binary search tree;
onsite: 1. infix expression evaluation of integers and + - * /; 2.
implement a system to route packets based on their priority; implement
associative container Map; 3. Given n nodes, each node has 2 blocking
functions: send(int to_id, int msg); recv(int from_id); each node has a
value; design a method to distribute the sum of all values on every node to
all nodes; 4. ... 阅读全帖
M*****8
发帖数: 17722
31
【 以下文字转载自 Military 讨论区 】
发信人: MB80528 (肥猫(Contrarian)[食MM而肥]), 信区: Military
标 题: Re: 2013年7月9日最新的1688个看跌的股票。
发信站: BBS 未名空间站 (Tue Jul 9 22:18:23 2013, 美东)
2013年7月9日最新的1688个看跌的股票。
多数到顶。墙街已深入插管,吸血在即。
排列依次为,号码,股票符号,收市价。
#0001, A , 44.6000
#0002, AA , 7.9010
#0003, AAGIY , 17.1600
#0004, AAMRQ , 4.7300
#0005, AAN , 28.9700
#0006, AAON , 24.7400
#0007, AAP , 83.2000
#0008, AAUKY , 9.5300
#0009, ABAX , 50.2800
#0010, AB... 阅读全帖
w***g
发帖数: 5958
32
来自主题: JobHunting版 - 最近一道面试题分享
我靠,不会是以面试之名找人解决难题吧。
如果是Linux机器的话用命令netstat -tp, 可以显示类似如下内容。
本地哪个端口连了远程哪个端口都有了。都不用手工每台机器上放一个程序。
直接pdsh netstat -tp, 然后分析输出的数据就行了。
牛人用几行脚本搞定的事情外行往往需要花一个星期写很多行程序才能勉强弄出来。
再不济的自己搞不定还要以面试之名找人来搞,并且给出一个暴露自己水平的面试题。
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
PID/Program name
tcp 1 0 localhost:4... 阅读全帖
d**********6
发帖数: 4434
33
来自主题: JobHunting版 - 问道FB的题
题目不是已经说好了吗,如果没有,缓存已读内容,call recv again and again直到遇
到n,每次call都append已读内容进缓存
z***m
发帖数: 1602
34
来自主题: JobHunting版 - 问道FB的题
不会这么简单吧?
string buffer;
while(true)
{
string line = recv();
buffer += readLine();
if (line.find("\n) == npos){
return buffer;
}
}
t**s
发帖数: 6972
35
来自主题: Living版 - comcast为什么总掉线
你观察一下是modem的问题还是你自己的无线网络的问题。
comcast modem上有些信号灯(send, recv, online),应该是一直solid的。如果闪的话
,是comcast的问题,叫他们来修。
a*******d
发帖数: 4846
36
1/17 open acct
1/20 welcome email recv
still waiting for my debit card to arrive
v***n
发帖数: 5085
37
来自主题: Money版 - 怎么从家里弄钱过来?
just wire transfer, 15 dollar on the recv end
M*****8
发帖数: 17722
38
【 以下文字转载自 Military 讨论区 】
发信人: MB80528 (肥猫(Contrarian)[食MM而肥]), 信区: Military
标 题: Re: 2013年7月9日最新的1688个看跌的股票。
发信站: BBS 未名空间站 (Tue Jul 9 22:18:23 2013, 美东)
2013年7月9日最新的1688个看跌的股票。
多数到顶。墙街已深入插管,吸血在即。
排列依次为,号码,股票符号,收市价。
#0001, A , 44.6000
#0002, AA , 7.9010
#0003, AAGIY , 17.1600
#0004, AAMRQ , 4.7300
#0005, AAN , 28.9700
#0006, AAON , 24.7400
#0007, AAP , 83.2000
#0008, AAUKY , 9.5300
#0009, ABAX , 50.2800
#0010, AB... 阅读全帖
M*****8
发帖数: 17722
39
【 以下文字转载自 Military 讨论区 】
发信人: MB80528 (肥猫(Contrarian)[食MM而肥]), 信区: Military
标 题: Re: 2013年7月9日最新的1688个看跌的股票。
发信站: BBS 未名空间站 (Tue Jul 9 22:18:23 2013, 美东)
2013年7月9日最新的1688个看跌的股票。
多数到顶。墙街已深入插管,吸血在即。
排列依次为,号码,股票符号,收市价。
#0001, A , 44.6000
#0002, AA , 7.9010
#0003, AAGIY , 17.1600
#0004, AAMRQ , 4.7300
#0005, AAN , 28.9700
#0006, AAON , 24.7400
#0007, AAP , 83.2000
#0008, AAUKY , 9.5300
#0009, ABAX , 50.2800
#0010, AB... 阅读全帖
j**l
发帖数: 2911
40
来自主题: Immigration版 - 【update】RFE!
怕怕呀!我也是17号的recv day, 还在等!
s****y
发帖数: 371
41
来自主题: Immigration版 - 看了485统计贴,10月RD心寒啊
再难过一阵就习惯了。有跟我同一天recv的,人家一个半月前就绿了。
v***n
发帖数: 5085
42
485 rd 12/13, no further notice recv'd yet.
v***n
发帖数: 5085
43
来自主题: EB23版 - 貌似按照RD在批
NSC are approving cases recv'd in Dec now!
u***a
发帖数: 409
44
俺的 100 is send out by paypal echeck. It looks like it will take you 3-5
days to recv it. let me know if there is other faster options i can use.
M*****8
发帖数: 17722
45
【 以下文字转载自 Military 讨论区 】
发信人: MB80528 (肥猫(Contrarian)[食MM而肥]), 信区: Military
标 题: Re: 2013年7月9日最新的1688个看跌的股票。
发信站: BBS 未名空间站 (Tue Jul 9 22:18:23 2013, 美东)
2013年7月9日最新的1688个看跌的股票。
多数到顶。墙街已深入插管,吸血在即。
排列依次为,号码,股票符号,收市价。
#0001, A , 44.6000
#0002, AA , 7.9010
#0003, AAGIY , 17.1600
#0004, AAMRQ , 4.7300
#0005, AAN , 28.9700
#0006, AAON , 24.7400
#0007, AAP , 83.2000
#0008, AAUKY , 9.5300
#0009, ABAX , 50.2800
#0010, AB... 阅读全帖
j****u
发帖数: 1413
46
That's so sweet.
I am glad to fund this scholarship. However,
for any girl who recvs more than 10 points,
she should fire her application with a photo.
haha
c********1
发帖数: 421
47
version of PHP 5.5 on Debian Wheezy 7.0/7.1/7.2 (and how to fix the GPG key
error)
BY CHRIS · SEPTEMBER 1, 2013
Please note: This works fine. But this package will also upgrade your apache
to version 2.4 which has different config files than apache 2.2 and even
deletes stuff, like /etc/apache2/sites-available/default when upgrading.
This may result in a loss of your apache settings (vhost, mod_rewrite stuff
etc.). Be aware of that ! This shit cost me a full weekend. :(
This affects only upgrades... 阅读全帖
c********1
发帖数: 421
48
http://www.dev-metal.com/setup-latest-version-php-5-5-debian-wh
How to install/setup latest version of PHP 5.5 on Debian Wheezy 7.0/7.1/7.2
(and how to fix the GPG key error)
BY CHRIS · SEPTEMBER 1, 2013
Please note: This works fine. But this package will also upgrade your apache
to version 2.4 which has different config files than apache 2.2 and even
deletes stuff, like /etc/apache2/sites-available/default when upgrading.
This may result in a loss of your apache settings (vhost, mod_rewrite stu... 阅读全帖
s****r
发帖数: 710
49
来自主题: CS版 - MPI问题求助。Help! (转载)
【 以下文字转载自 Programming 讨论区 】
发信人: sniper (清风拂山岗), 信区: Programming
标 题: MPI问题求助。Help!
发信站: BBS 未名空间站 (Sun Dec 3 17:40:08 2006)
程序在运行时遇到如下错误:
Error: blocking send or recv on a self communication
Command terminated on signal 9.
我猜问题可能是由于程序中ROOT(MPI_ID=0)与其它ID通讯时没有特殊处理本地通讯而造
成的。也就是说MPI_Isend & MPI_Recv配对工作时,收发双方是同一个MPI_ID。我的理
解正确吗?
奇怪的是,我在不同平台上运行。似乎有的MPI系统不认为这是一个问题,而有的MPI系
统就认为这是错误。请问你们遇到过这样的现象吗?谢谢指教。
d******a
发帖数: 32122
50
来自主题: Hardware版 - GPG验证到底有什么好处?
我下载软件,都习惯验证一下。一般软件要么有电子签名,要么有sha1码(很多软件如
7zip可以计算sha1)
我这次下载lyx, 网站上让我经过好几步来进行gpg验证,至于这么麻烦嘛。
We provide gpg-signed tarballs and binaries. Our GPG key ID is
0xDE7A44FAC7FB382D (LyX Release Manager). The signatures are found next to
the tarballs and binaries.
To initially import our key via GnuPG, do this:
gpg --recv-keys FE66471B43559707AFDAD955DE7A44FAC7FB382D
Attention: Please be careful to use this full fingerprint, spoofed version
of shortened fingerprint is already in the wild and it... 阅读全帖
1 2 下页 末页 (共2页)